diff options
Diffstat (limited to 'src/onaptests/steps/simulator')
-rw-r--r-- | src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py b/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py index 0e6e001..3a846e3 100644 --- a/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py +++ b/src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py @@ -46,7 +46,10 @@ class PnfSimulatorCnfRegisterStep(BaseStep): bool: True if PNF simulator pod is running, False otherwise """ - config.load_kube_config(settings.K8S_CONFIG) + if settings.IN_CLUSTER: + config.load_incluster_config() + else: + config.load_kube_config(config_file=settings.K8S_CONFIG) k8s_client: "CoreV1API" = client.CoreV1Api() k8s_watch: "Watch" = watch.Watch() status = False @@ -75,7 +78,10 @@ class PnfSimulatorCnfRegisterStep(BaseStep): Tuple[str, str, str]: VES protocol, IP and port """ - config.load_kube_config(settings.K8S_CONFIG) + if settings.IN_CLUSTER: + config.load_incluster_config() + else: + config.load_kube_config(config_file=settings.K8S_CONFIG) k8s_client: "CoreV1API" = client.CoreV1Api() try: for service in k8s_client.list_namespaced_service(namespace=settings.K8S_ONAP_NAMESPACE).items: |