examples/pod_exec.py: fix example

Use get_default_copy() API with configuration.
This commit is contained in:
Abhijeet Kasurde 2021-03-23 10:24:58 +05:30 committed by Haowei Cai
parent 86cd342c63
commit eb9db7762d

View File

@ -117,8 +117,11 @@ def exec_commands(api_instance):
def main():
config.load_kube_config()
c = Configuration()
c.assert_hostname = False
try:
c = Configuration().get_default_copy()
except AttributeError:
c = Configuration()
c.assert_hostname = False
Configuration.set_default(c)
core_v1 = core_v1_api.CoreV1Api()