MCPcopy Index your code
hub / github.com/kubernetes-client/python / get_e2e_configuration

Function get_e2e_configuration

kubernetes/e2e_test/base.py:23–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def get_e2e_configuration():
24 config = Configuration()
25 config.host = None
26 if os.path.exists(
27 os.path.expanduser(kube_config.KUBE_CONFIG_DEFAULT_LOCATION)):
28 kube_config.load_kube_config(client_configuration=config)
29 else:
30 print('Unable to load config from %s' %
31 kube_config.KUBE_CONFIG_DEFAULT_LOCATION)
32 for url in ['https://%s:8443' % DEFAULT_E2E_HOST,
33 'http://%s:8080' % DEFAULT_E2E_HOST]:
34 try:
35 urllib3.PoolManager().request('GET', url)
36 config.host = url
37 config.verify_ssl = False
38 urllib3.disable_warnings()
39 break
40 except urllib3.exceptions.HTTPError:
41 pass
42 if config.host is None:
43 raise unittest.SkipTest('Unable to find a running Kubernetes instance')
44 print('Running test against : %s' % config.host)
45 config.assert_hostname = False
46 return config

Callers

nothing calls this directly

Calls 2

ConfigurationClass · 0.90
requestMethod · 0.45

Tested by

no test coverage detected