()
| 21 | |
| 22 | |
| 23 | def 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 |
nothing calls this directly
no test coverage detected