diff --git a/src/main/java/io/odh/test/framework/logs/LogCollector.java b/src/main/java/io/odh/test/framework/logs/LogCollector.java index ec49b498..fcba860b 100644 --- a/src/main/java/io/odh/test/framework/logs/LogCollector.java +++ b/src/main/java/io/odh/test/framework/logs/LogCollector.java @@ -76,7 +76,7 @@ private static void writePodsDescription(Path logpath, Pod pod) { try { LOGGER.debug("Get description of pod {}/{}", pod.getMetadata().getNamespace(), pod.getMetadata().getName()); Files.writeString(logpath.resolve(pod.getMetadata().getNamespace()).resolve(pod.getMetadata().getName() + ".describe.log"), - KubeResourceManager.getKubeCmdClient().namespace(pod.getMetadata().getNamespace()).describe(pod.getKind(), pod.getMetadata().getName())); + KubeResourceManager.getKubeCmdClient().inNamespace(pod.getMetadata().getNamespace()).describe(pod.getKind(), pod.getMetadata().getName())); } catch (Exception e) { LOGGER.warn("Cannot get description of pod {}/{}", pod.getMetadata().getNamespace(), pod.getMetadata().getName()); } diff --git a/src/main/java/io/odh/test/framework/manager/resources/DataScienceClusterResource.java b/src/main/java/io/odh/test/framework/manager/resources/DataScienceClusterResource.java index 49728044..ff2fff56 100644 --- a/src/main/java/io/odh/test/framework/manager/resources/DataScienceClusterResource.java +++ b/src/main/java/io/odh/test/framework/manager/resources/DataScienceClusterResource.java @@ -169,8 +169,8 @@ record ConditionExpectation(String conditionType, String expectedStatus) { } String namespace = OdhConstants.CONTROLLERS_NAMESPACE; LOGGER.info("Waiting for pods readiness in {}", namespace); PodUtils.waitForPodsReady(namespace, true, () -> { - KubeResourceManager.getKubeCmdClient().namespace(namespace).exec(false, "get", "pods"); - KubeResourceManager.getKubeCmdClient().namespace(namespace).exec(false, "get", "events"); + KubeResourceManager.getKubeCmdClient().inNamespace(namespace).exec(false, "get", "pods"); + KubeResourceManager.getKubeCmdClient().inNamespace(namespace).exec(false, "get", "events"); }); return true; diff --git a/src/main/java/io/odh/test/framework/manager/resources/InferenceServiceResource.java b/src/main/java/io/odh/test/framework/manager/resources/InferenceServiceResource.java index a064bc5f..5880b6e2 100644 --- a/src/main/java/io/odh/test/framework/manager/resources/InferenceServiceResource.java +++ b/src/main/java/io/odh/test/framework/manager/resources/InferenceServiceResource.java @@ -76,8 +76,8 @@ public boolean waitForReadiness(InferenceService resource) { String namespace = resource.getMetadata().getNamespace(); LOGGER.info("Waiting for pods readiness in {}", namespace); PodUtils.waitForPodsReady(namespace, true, () -> { - KubeResourceManager.getKubeCmdClient().namespace(namespace).exec(false, "get", "pods"); - KubeResourceManager.getKubeCmdClient().namespace(namespace).exec(false, "get", "events"); + KubeResourceManager.getKubeCmdClient().inNamespace(namespace).exec(false, "get", "pods"); + KubeResourceManager.getKubeCmdClient().inNamespace(namespace).exec(false, "get", "events"); }); return true; diff --git a/src/test/java/io/odh/test/e2e/standard/ModelServingST.java b/src/test/java/io/odh/test/e2e/standard/ModelServingST.java index 9200db2a..b9d1cd0e 100644 --- a/src/test/java/io/odh/test/e2e/standard/ModelServingST.java +++ b/src/test/java/io/odh/test/e2e/standard/ModelServingST.java @@ -211,8 +211,8 @@ void testMultiModelServerInference() { String namespace = "knative-serving"; LOGGER.info("Waiting for pods readiness in {}", namespace); PodUtils.waitForPodsReady(namespace, true, () -> { - KubeResourceManager.getKubeCmdClient().namespace(namespace).exec(false, "get", "pods"); - KubeResourceManager.getKubeCmdClient().namespace(namespace).exec(false, "get", "events"); + KubeResourceManager.getKubeCmdClient().inNamespace(namespace).exec(false, "get", "pods"); + KubeResourceManager.getKubeCmdClient().inNamespace(namespace).exec(false, "get", "events"); }); Route route = kubeClient.routes().inNamespace(projectName).withName(modelName).get(); diff --git a/src/test/java/io/odh/test/e2e/standard/UninstallST.java b/src/test/java/io/odh/test/e2e/standard/UninstallST.java index e22a996f..284821b9 100644 --- a/src/test/java/io/odh/test/e2e/standard/UninstallST.java +++ b/src/test/java/io/odh/test/e2e/standard/UninstallST.java @@ -73,7 +73,7 @@ public class UninstallST extends StandardAbstract { ) @Test void testUninstallSimpleScenario() { - if (KubeResourceManager.getKubeCmdClient().namespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( + if (KubeResourceManager.getKubeCmdClient().inNamespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( "configmap").contains(DELETE_CONFIG_MAP_NAME)) { Assertions.fail( String.format("The ConfigMap '%s' is present on the cluster before the uninstall test started!", @@ -95,12 +95,12 @@ void testUninstallSimpleScenario() { () -> !KubeResourceManager.getKubeClient().namespaceExists(OdhConstants.CONTROLLERS_NAMESPACE)); // Operator itself should delete the CSV, Subscription and InstallPlan - Assertions.assertTrue(KubeResourceManager.getKubeCmdClient().namespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( + Assertions.assertTrue(KubeResourceManager.getKubeCmdClient().inNamespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( "subscriptions").isEmpty(), "The operator Subscription is still present!"); - Assertions.assertTrue(KubeResourceManager.getKubeCmdClient().namespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( + Assertions.assertTrue(KubeResourceManager.getKubeCmdClient().inNamespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( "installplan").isEmpty(), "The operator InstallPlan is still present!"); - Assertions.assertFalse(KubeResourceManager.getKubeCmdClient().namespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( - "csv").stream().anyMatch(s -> s.toString().contains(OdhConstants.OLM_OPERATOR_NAME)), + Assertions.assertFalse(KubeResourceManager.getKubeCmdClient().inNamespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( + "csv").stream().anyMatch(s -> s.contains(OdhConstants.OLM_OPERATOR_NAME)), "The operator CSV is still present!"); // TODO Check that the config map is deleted also