Improve-CPS-sanity-test 03/135903/1
authorpawel.denst <pawel.denst@external.t-mobile.pl>
Mon, 4 Sep 2023 11:33:57 +0000 (11:33 +0000)
committerpawel.denst <pawel.denst@external.t-mobile.pl>
Mon, 4 Sep 2023 11:33:57 +0000 (11:33 +0000)
Improve-CPS-sanity-test

Issue-ID: INT-2263
Signed-off-by: pawel.denst <pawel.denst@external.t-mobile.pl>
Change-Id: Iab13759245c2f355d68bbf55d1a03087cd6c3d6d

src/onaptests/steps/onboard/cps.py

index 60e1990..f5820c7 100644 (file)
@@ -261,7 +261,10 @@ class CheckPostgressDataBaseConnectionStep(CpsBaseStep):
         return "Establish connection with Postgress and execute the query"
 
     def get_database_credentials(self):
-        config.load_kube_config()
+        if settings.IN_CLUSTER:
+            config.load_incluster_config()
+        else:
+            config.load_kube_config(config_file=settings.K8S_CONFIG)
         api_instance = client.CoreV1Api()
         try:
             secret = api_instance.read_namespaced_secret(