From 4e4df097b1c0e5eaf25c1497ef4fb0f68b7ad184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Dan=C4=9Bk?= Date: Sun, 10 Mar 2024 16:39:12 +0100 Subject: [PATCH] Wait for even more DataScienceCluster conditions to finish reconciling --- .../resources/DataScienceClusterResource.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 56b3c373..e0a13a6b 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 @@ -113,6 +113,22 @@ public boolean waitForReadiness(DataScienceCluster resource) { // Check that DSC reconciliation has been successfully finalized // https://github.com/red-hat-data-services/rhods-operator/blob/rhoai-2.8/controllers/datasciencecluster/datasciencecluster_controller.go#L257 + // Wait for standard Kubernetes condition types (status for the whole DSC) + record ConditionExpectation(String conditionType, String expectedStatus) { } + List conditionExpectations = List.of( + new ConditionExpectation("Available", "True"), + new ConditionExpectation("Progressing", "False"), + new ConditionExpectation("Degraded", "False"), + new ConditionExpectation("Upgradeable", "True") + ); + for (ConditionExpectation conditionExpectation : conditionExpectations) { + String conditionType = conditionExpectation.conditionType; + String expectedStatus = conditionExpectation.expectedStatus; + String conditionStatus = KubeUtils.getDscConditionByType(dsc.getStatus().getConditions(), conditionType).getStatus(); + LOGGER.debug("DataScienceCluster {} {} status: {}", resource.getMetadata().getName(), conditionType, conditionStatus); + dscReady = dscReady && Objects.equals(conditionStatus, expectedStatus); + } + // Wait for ReconcileComplete condition (for the whole DSC) String reconcileStatus = KubeUtils.getDscConditionByType(dsc.getStatus().getConditions(), "ReconcileComplete").getStatus(); LOGGER.debug("DataScienceCluster {} ReconcileComplete status: {}", resource.getMetadata().getName(), reconcileStatus);