diff options
author | 2023-06-05 08:00:55 +0000 | |
---|---|---|
committer | 2023-06-15 18:42:22 +0000 | |
commit | edfdf4f8beb8de3dd763fe744655067d03923d8e (patch) | |
tree | fbdb3483ccfa38bad0527517d8cef799d53bfd7b /src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py | |
parent | c458ace517bb640de7ec05cd2a26e33cfcac21e2 (diff) |
Modify Python ONAP SDK tests to not require kubeconfig
Modify Python ONAP SDK tests to not require kubeconfig
Issue-ID: INT-2247
Signed-off-by: pawel.denst <pawel.denst@external.t-mobile.pl>
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Change-Id: I0d61250a2373d8549696cedaa2c0c5fb721d0e3b
Diffstat (limited to 'src/onaptests/steps/simulator/pnf_simulator_cnf/pnf_register.py')
-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: |