From edfdf4f8beb8de3dd763fe744655067d03923d8e Mon Sep 17 00:00:00 2001 From: "pawel.denst" Date: Mon, 5 Jun 2023 08:00:55 +0000 Subject: 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 Signed-off-by: Lukasz Rajewski Change-Id: I0d61250a2373d8549696cedaa2c0c5fb721d0e3b --- .../steps/simulator/pnf_simulator_cnf/pnf_register.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/onaptests/steps/simulator') 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: -- cgit 1.2.3-korg