Skip to content

Commit

Permalink
Fix new api for cmd cli
Browse files Browse the repository at this point in the history
Signed-off-by: David Kornel <[email protected]>
  • Loading branch information
kornys committed May 9, 2024
1 parent b656693 commit 987d096
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/odh/test/framework/logs/LogCollector.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/io/odh/test/e2e/standard/ModelServingST.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions src/test/java/io/odh/test/e2e/standard/UninstallST.java
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand All @@ -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
Expand Down

0 comments on commit 987d096

Please sign in to comment.