From 9add95ab4eaa1a9020de83d5bba61d438bfe49e7 Mon Sep 17 00:00:00 2001 From: Jan Stourac Date: Thu, 1 Feb 2024 12:46:44 +0100 Subject: [PATCH] Added a check for Uninstall scenario (#80) --- src/main/java/io/odh/test/OdhConstants.java | 2 + .../java/io/odh/test/platform/KubeClient.java | 2 +- src/main/java/io/odh/test/utils/DscUtils.java | 95 +++++++++++++++++++ .../e2e/standard/DataScienceClusterST.java | 75 +-------------- .../io/odh/test/e2e/standard/NotebookST.java | 28 +----- .../io/odh/test/e2e/standard/UninstallST.java | 93 ++++++++++++++++++ .../odh/test/e2e/upgrade/UpgradeAbstract.java | 28 +----- 7 files changed, 200 insertions(+), 123 deletions(-) create mode 100644 src/main/java/io/odh/test/utils/DscUtils.java create mode 100644 src/test/java/io/odh/test/e2e/standard/UninstallST.java diff --git a/src/main/java/io/odh/test/OdhConstants.java b/src/main/java/io/odh/test/OdhConstants.java index 05007d1d..fe7f6bca 100644 --- a/src/main/java/io/odh/test/OdhConstants.java +++ b/src/main/java/io/odh/test/OdhConstants.java @@ -41,6 +41,7 @@ private OdhConstants() { } private static final String RHOAI_CONTROLLERS_NAMESPACE = "redhat-ods-applications"; private static final String RHOAI_DASHBOARD_ROUTE_NAME = "rhods-dashboard"; private static final String RHOAI_DASHBOARD_CONTROLLER = "rhods-dashboard"; + private static final String RHOAI_NOTEBOOKS_NAMESPACE = "rhods-notebooks"; private static final String RHOAI_DSCI_NAME = "default-dsci"; // RHOAI OLM private static final String RHOAI_OLM_OPERATOR_NAME = "rhods-operator"; @@ -68,6 +69,7 @@ private OdhConstants() { } public static final String CONTROLLERS_NAMESPACE = getOdhOrRhoai("CONTROLLERS_NAMESPACE", ODH_CONTROLLERS_NAMESPACE, RHOAI_CONTROLLERS_NAMESPACE); public static final String DASHBOARD_ROUTE_NAME = getOdhOrRhoai("DASHBOARD_ROUTE_NAME", ODH_DASHBOARD_ROUTE_NAME, RHOAI_DASHBOARD_ROUTE_NAME); public static final String DASHBOARD_CONTROLLER = getOdhOrRhoai("DASHBOARD_CONTROLLER", ODH_DASHBOARD_CONTROLLER, RHOAI_DASHBOARD_CONTROLLER); + public static final String NOTEBOOKS_NAMESPACE = getOdhOrRhoai("NOTEBOOKS_NAMESPACE", ODH_CONTROLLERS_NAMESPACE, RHOAI_NOTEBOOKS_NAMESPACE); public static final String BUNDLE_OPERATOR_NAMESPACE = getOdhOrRhoai("BUNDLE_OPERATOR_NAMESPACE", ODH_BUNDLE_OPERATOR_NAME, RHOAI_OLM_OPERATOR_NAME); public static final String DEFAULT_DSCI_NAME = getOdhOrRhoai("DSCI_NAME", ODH_DSCI_NAME, RHOAI_DSCI_NAME); public static final String MONITORING_NAMESPACE = getOdhOrRhoai("MONITORING_NAMESPACE", ODH_MONITORING_NAMESPACE, RHOAI_MONITORING_NAMESPACE); diff --git a/src/main/java/io/odh/test/platform/KubeClient.java b/src/main/java/io/odh/test/platform/KubeClient.java index 9ce9d302..476acfef 100644 --- a/src/main/java/io/odh/test/platform/KubeClient.java +++ b/src/main/java/io/odh/test/platform/KubeClient.java @@ -141,7 +141,7 @@ public String getKubeconfigPath() { } // ================================================== - // ---------> Create/read multi-resoruces <--------- + // ---------> Create/read multi-resources <--------- // ================================================== public void create(String namespace, InputStream is, Function modifier) throws IOException { try (is) { diff --git a/src/main/java/io/odh/test/utils/DscUtils.java b/src/main/java/io/odh/test/utils/DscUtils.java new file mode 100644 index 00000000..32bb1c8e --- /dev/null +++ b/src/main/java/io/odh/test/utils/DscUtils.java @@ -0,0 +1,95 @@ +/* + * Copyright Skodjob authors. + * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). + */ +package io.odh.test.utils; + +import io.odh.test.OdhConstants; +import io.odh.test.framework.manager.requirements.ServiceMeshOperator; +import io.opendatahub.datasciencecluster.v1.DataScienceCluster; +import io.opendatahub.datasciencecluster.v1.DataScienceClusterBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.ComponentsBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Codeflare; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.CodeflareBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Dashboard; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.DashboardBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Datasciencepipelines; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.DatasciencepipelinesBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Kserve; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.KserveBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Modelmeshserving; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.ModelmeshservingBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Ray; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.RayBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Trustyai; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.TrustyaiBuilder; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Workbenches; +import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.WorkbenchesBuilder; +import io.opendatahub.dscinitialization.v1.DSCInitialization; +import io.opendatahub.dscinitialization.v1.DSCInitializationBuilder; +import io.opendatahub.dscinitialization.v1.dscinitializationspec.Monitoring; +import io.opendatahub.dscinitialization.v1.dscinitializationspec.ServiceMesh; +import io.opendatahub.dscinitialization.v1.dscinitializationspec.servicemesh.ControlPlane; + +public class DscUtils { + + public static DSCInitialization getBasicDSCI() { + return new DSCInitializationBuilder() + .withNewMetadata() + .withName(OdhConstants.DEFAULT_DSCI_NAME) + .endMetadata() + .withNewSpec() + .withApplicationsNamespace(OdhConstants.CONTROLLERS_NAMESPACE) + .withNewMonitoring() + .withManagementState(Monitoring.ManagementState.MANAGED) + .withNamespace(OdhConstants.MONITORING_NAMESPACE) + .endMonitoring() + .withNewServiceMesh() + .withManagementState(ServiceMesh.ManagementState.MANAGED) + .withNewControlPlane() + .withName(ServiceMeshOperator.SERVICE_MESH_NAME) + .withNamespace(ServiceMeshOperator.SERVICE_MESH_NAMESPACE) + .withMetricsCollection(ControlPlane.MetricsCollection.ISTIO) + .endControlPlane() + .endServiceMesh() + .endSpec() + .build(); + } + + public static DataScienceCluster getBasicDSC(String dsProjectName) { + return new DataScienceClusterBuilder() + .withNewMetadata() + .withName(dsProjectName) + .endMetadata() + .withNewSpec() + .withComponents( + new ComponentsBuilder() + .withWorkbenches( + new WorkbenchesBuilder().withManagementState(Workbenches.ManagementState.MANAGED).build() + ) + .withDashboard( + new DashboardBuilder().withManagementState(Dashboard.ManagementState.MANAGED).build() + ) + .withKserve( + new KserveBuilder().withManagementState(Kserve.ManagementState.MANAGED).build() + ) + .withCodeflare( + new CodeflareBuilder().withManagementState(Codeflare.ManagementState.MANAGED).build() + ) + .withDatasciencepipelines( + new DatasciencepipelinesBuilder().withManagementState(Datasciencepipelines.ManagementState.MANAGED).build() + ) + .withModelmeshserving( + new ModelmeshservingBuilder().withManagementState(Modelmeshserving.ManagementState.MANAGED).build() + ) + .withRay( + new RayBuilder().withManagementState(Ray.ManagementState.MANAGED).build() + ) + .withTrustyai( + new TrustyaiBuilder().withManagementState(Trustyai.ManagementState.MANAGED).build() + ) + .build()) + .endSpec() + .build(); + } +} diff --git a/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java b/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java index 3028d175..23036f94 100644 --- a/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java +++ b/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java @@ -4,35 +4,20 @@ */ package io.odh.test.e2e.standard; -import io.odh.test.OdhConstants; import io.odh.test.TestSuite; import io.odh.test.framework.manager.ResourceManager; -import io.odh.test.framework.manager.requirements.ServiceMeshOperator; import io.odh.test.framework.manager.resources.DataScienceClusterResource; +import io.odh.test.utils.DscUtils; import io.opendatahub.datasciencecluster.v1.DataScienceCluster; -import io.opendatahub.datasciencecluster.v1.DataScienceClusterBuilder; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.ComponentsBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Codeflare; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.CodeflareBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Dashboard; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.DashboardBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Datasciencepipelines; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.DatasciencepipelinesBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Kserve; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.KserveBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Modelmeshserving; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.ModelmeshservingBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Ray; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.RayBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Trustyai; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.TrustyaiBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Workbenches; -import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.WorkbenchesBuilder; import io.opendatahub.dscinitialization.v1.DSCInitialization; -import io.opendatahub.dscinitialization.v1.DSCInitializationBuilder; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.Monitoring; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.ServiceMesh; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.servicemesh.ControlPlane; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -45,61 +30,11 @@ public class DataScienceClusterST extends StandardAbstract { @Test void createDataScienceCluster() { - DSCInitialization dsci = new DSCInitializationBuilder() - .withNewMetadata() - .withName(OdhConstants.DEFAULT_DSCI_NAME) - .endMetadata() - .withNewSpec() - .withApplicationsNamespace(OdhConstants.CONTROLLERS_NAMESPACE) - .withNewMonitoring() - .withManagementState(Monitoring.ManagementState.MANAGED) - .withNamespace(OdhConstants.MONITORING_NAMESPACE) - .endMonitoring() - .withNewServiceMesh() - .withManagementState(ServiceMesh.ManagementState.MANAGED) - .withNewControlPlane() - .withName(ServiceMeshOperator.SERVICE_MESH_NAME) - .withNamespace(ServiceMeshOperator.SERVICE_MESH_NAMESPACE) - .withMetricsCollection(ControlPlane.MetricsCollection.ISTIO) - .endControlPlane() - .endServiceMesh() - .endSpec() - .build(); - DataScienceCluster c = new DataScienceClusterBuilder() - .withNewMetadata() - .withName(DS_PROJECT_NAME) - .endMetadata() - .withNewSpec() - .withComponents( - new ComponentsBuilder() - .withWorkbenches( - new WorkbenchesBuilder().withManagementState(Workbenches.ManagementState.MANAGED).build() - ) - .withDashboard( - new DashboardBuilder().withManagementState(Dashboard.ManagementState.MANAGED).build() - ) - .withKserve( - new KserveBuilder().withManagementState(Kserve.ManagementState.MANAGED).build() - ) - .withCodeflare( - new CodeflareBuilder().withManagementState(Codeflare.ManagementState.MANAGED).build() - ) - .withDatasciencepipelines( - new DatasciencepipelinesBuilder().withManagementState(Datasciencepipelines.ManagementState.MANAGED).build() - ) - .withModelmeshserving( - new ModelmeshservingBuilder().withManagementState(Modelmeshserving.ManagementState.MANAGED).build() - ) - .withRay( - new RayBuilder().withManagementState(Ray.ManagementState.MANAGED).build() - ) - .withTrustyai( - new TrustyaiBuilder().withManagementState(Trustyai.ManagementState.MANAGED).build() - ) - .build()) - .endSpec() - .build(); + // Create DSCI + DSCInitialization dsci = DscUtils.getBasicDSCI(); + // Create DSC + DataScienceCluster c = DscUtils.getBasicDSC(DS_PROJECT_NAME); ResourceManager.getInstance().createResourceWithWait(dsci); ResourceManager.getInstance().createResourceWithWait(c); diff --git a/src/test/java/io/odh/test/e2e/standard/NotebookST.java b/src/test/java/io/odh/test/e2e/standard/NotebookST.java index f3012b25..cd74230d 100644 --- a/src/test/java/io/odh/test/e2e/standard/NotebookST.java +++ b/src/test/java/io/odh/test/e2e/standard/NotebookST.java @@ -12,10 +12,9 @@ import io.fabric8.kubernetes.api.model.PersistentVolumeClaimBuilder; import io.fabric8.kubernetes.api.model.Quantity; import io.odh.test.OdhAnnotationsLabels; -import io.odh.test.OdhConstants; import io.odh.test.framework.manager.ResourceManager; -import io.odh.test.framework.manager.requirements.ServiceMeshOperator; import io.odh.test.framework.manager.resources.NotebookResource; +import io.odh.test.utils.DscUtils; import io.odh.test.utils.PodUtils; import io.opendatahub.datasciencecluster.v1.DataScienceCluster; import io.opendatahub.datasciencecluster.v1.DataScienceClusterBuilder; @@ -37,10 +36,6 @@ import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Workbenches; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.WorkbenchesBuilder; import io.opendatahub.dscinitialization.v1.DSCInitialization; -import io.opendatahub.dscinitialization.v1.DSCInitializationBuilder; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.Monitoring; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.ServiceMesh; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.servicemesh.ControlPlane; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.kubeflow.v1.Notebook; @@ -97,26 +92,7 @@ void testCreateSimpleNotebook() throws IOException { @BeforeAll void deployDataScienceCluster() { // Create DSCI - DSCInitialization dsci = new DSCInitializationBuilder() - .withNewMetadata() - .withName(OdhConstants.DEFAULT_DSCI_NAME) - .endMetadata() - .withNewSpec() - .withApplicationsNamespace(OdhConstants.CONTROLLERS_NAMESPACE) - .withNewMonitoring() - .withManagementState(Monitoring.ManagementState.MANAGED) - .withNamespace(OdhConstants.MONITORING_NAMESPACE) - .endMonitoring() - .withNewServiceMesh() - .withManagementState(ServiceMesh.ManagementState.MANAGED) - .withNewControlPlane() - .withName(ServiceMeshOperator.SERVICE_MESH_NAME) - .withNamespace(ServiceMeshOperator.SERVICE_MESH_NAMESPACE) - .withMetricsCollection(ControlPlane.MetricsCollection.ISTIO) - .endControlPlane() - .endServiceMesh() - .endSpec() - .build(); + DSCInitialization dsci = DscUtils.getBasicDSCI(); // Create DSC DataScienceCluster dsc = new DataScienceClusterBuilder() diff --git a/src/test/java/io/odh/test/e2e/standard/UninstallST.java b/src/test/java/io/odh/test/e2e/standard/UninstallST.java new file mode 100644 index 00000000..78e27119 --- /dev/null +++ b/src/test/java/io/odh/test/e2e/standard/UninstallST.java @@ -0,0 +1,93 @@ +/* + * Copyright Skodjob authors. + * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). + */ +package io.odh.test.e2e.standard; + +import java.util.Map; + +import io.fabric8.kubernetes.api.model.ConfigMap; +import io.fabric8.kubernetes.api.model.ConfigMapBuilder; +import io.odh.test.OdhConstants; +import io.odh.test.TestUtils; +import io.odh.test.framework.manager.ResourceManager; +import io.odh.test.utils.DscUtils; +import io.odh.test.utils.NamespaceUtils; +import io.opendatahub.datasciencecluster.v1.DataScienceCluster; +import io.opendatahub.dscinitialization.v1.DSCInitialization; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +@Disabled("Disabled because of the https://issues.redhat.com/browse/RHOAIENG-499") +public class UninstallST extends StandardAbstract { + + private static final String DS_PROJECT_NAME = "test-uninstall"; + private static final String DELETE_CONFIG_MAP_NAME = "delete-self-managed-odh"; + private static final String DELETE_ANNOTATION = "api.openshift.com/addon-managed-odh-delete"; + + /** + * Following the official Uninstallation steps for RHOAI: + *
+     * Uninstalling Red Hat OpenShift AI Self-Managed by using the CLI
+     * 
+ * + * Known issue RHOAIENG-499 + */ + @Test + void testUninstallSimpleScenario() { + if (!ResourceManager.getKubeCmdClient().namespace(OdhConstants.OLM_OPERATOR_NAMESPACE) + .list("configmap").contains(DELETE_CONFIG_MAP_NAME)) { + ConfigMap cm = new ConfigMapBuilder() + .withNewMetadata() + .withName(DELETE_CONFIG_MAP_NAME) + .withNamespace(OdhConstants.OLM_OPERATOR_NAMESPACE) + .withAnnotations(Map.ofEntries(Map.entry(DELETE_ANNOTATION, "true"))) + .endMetadata() + .build(); + ResourceManager.getInstance().createResourceWithWait(cm); + } else { + Assertions.fail(String.format("The configmap '%s' is present on the cluster before the uninstall test started!", DELETE_CONFIG_MAP_NAME)); + } + + // Now the product should start to uninstall, let's wait a bit and check the result. + TestUtils.waitFor(String.format("the '%s' namespace to be removed as operator is being uninstalled", + OdhConstants.CONTROLLERS_NAMESPACE), 2000, 20000, + () -> !ResourceManager.getKubeClient().namespaceExists(OdhConstants.CONTROLLERS_NAMESPACE)); + + // Let's remove the operator namespace now + ResourceManager.getKubeCmdClient().deleteNamespace(OdhConstants.OLM_OPERATOR_NAMESPACE); + NamespaceUtils.waitForNamespaceDeletion(OdhConstants.OLM_OPERATOR_NAMESPACE); + + // Check that all other expected resources have been deleted + Assertions.assertTrue(ResourceManager.getKubeCmdClient().namespace(OdhConstants.OLM_OPERATOR_NAMESPACE).list( + "subscriptions").isEmpty(), "The operator subscription is still present!"); + Assertions.assertFalse(ResourceManager.getKubeClient().namespaceExists(OdhConstants.MONITORING_NAMESPACE), + String.format("Namespace '%s' hasn't been removed by the operator uninstall operation!", + OdhConstants.MONITORING_NAMESPACE)); + Assertions.assertFalse(ResourceManager.getKubeClient().namespaceExists(OdhConstants.NOTEBOOKS_NAMESPACE), + String.format("Namespace '%s' hasn't been removed by the operator uninstall operation!", + OdhConstants.NOTEBOOKS_NAMESPACE)); + + // Following should be removed and we actually checked above already, so maybe remove from here TODO + Assertions.assertFalse(ResourceManager.getKubeClient().namespaceExists(OdhConstants.CONTROLLERS_NAMESPACE), + String.format("Namespace '%s' hasn't been removed by the operator uninstall operation!", + OdhConstants.CONTROLLERS_NAMESPACE)); + Assertions.assertFalse(ResourceManager.getKubeClient().namespaceExists(OdhConstants.OLM_OPERATOR_NAMESPACE), + String.format("Namespace '%s' hasn't been removed!", + OdhConstants.OLM_OPERATOR_NAMESPACE)); + } + + @BeforeAll + void deployDataScienceCluster() { + // Create DSCI + DSCInitialization dsci = DscUtils.getBasicDSCI(); + // Create DSC + DataScienceCluster dsc = DscUtils.getBasicDSC(DS_PROJECT_NAME); + + // Deploy DSCI,DSC + ResourceManager.getInstance().createResourceWithWait(dsci); + ResourceManager.getInstance().createResourceWithWait(dsc); + } +} diff --git a/src/test/java/io/odh/test/e2e/upgrade/UpgradeAbstract.java b/src/test/java/io/odh/test/e2e/upgrade/UpgradeAbstract.java index ebcea9ed..27281b1b 100644 --- a/src/test/java/io/odh/test/e2e/upgrade/UpgradeAbstract.java +++ b/src/test/java/io/odh/test/e2e/upgrade/UpgradeAbstract.java @@ -11,14 +11,13 @@ import io.fabric8.kubernetes.api.model.Quantity; import io.odh.test.Environment; import io.odh.test.OdhAnnotationsLabels; -import io.odh.test.OdhConstants; import io.odh.test.TestSuite; import io.odh.test.e2e.Abstract; import io.odh.test.framework.listeners.OdhResourceCleaner; import io.odh.test.framework.listeners.ResourceManagerDeleteHandler; import io.odh.test.framework.manager.ResourceManager; -import io.odh.test.framework.manager.requirements.ServiceMeshOperator; import io.odh.test.framework.manager.resources.NotebookResource; +import io.odh.test.utils.DscUtils; import io.opendatahub.datasciencecluster.v1.DataScienceCluster; import io.opendatahub.datasciencecluster.v1.DataScienceClusterBuilder; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.ComponentsBuilder; @@ -39,10 +38,6 @@ import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.Workbenches; import io.opendatahub.datasciencecluster.v1.datascienceclusterspec.components.WorkbenchesBuilder; import io.opendatahub.dscinitialization.v1.DSCInitialization; -import io.opendatahub.dscinitialization.v1.DSCInitializationBuilder; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.Monitoring; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.ServiceMesh; -import io.opendatahub.dscinitialization.v1.dscinitializationspec.servicemesh.ControlPlane; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.extension.ExtendWith; import org.kubeflow.v1.Notebook; @@ -57,26 +52,7 @@ public abstract class UpgradeAbstract extends Abstract { protected void deployDsc(String name) { - DSCInitialization dsci = new DSCInitializationBuilder() - .withNewMetadata() - .withName(OdhConstants.DEFAULT_DSCI_NAME) - .endMetadata() - .withNewSpec() - .withApplicationsNamespace(OdhConstants.CONTROLLERS_NAMESPACE) - .withNewMonitoring() - .withManagementState(Monitoring.ManagementState.MANAGED) - .withNamespace(OdhConstants.MONITORING_NAMESPACE) - .endMonitoring() - .withNewServiceMesh() - .withManagementState(ServiceMesh.ManagementState.MANAGED) - .withNewControlPlane() - .withName(ServiceMeshOperator.SERVICE_MESH_NAME) - .withNamespace(ServiceMeshOperator.SERVICE_MESH_NAMESPACE) - .withMetricsCollection(ControlPlane.MetricsCollection.ISTIO) - .endControlPlane() - .endServiceMesh() - .endSpec() - .build(); + DSCInitialization dsci = DscUtils.getBasicDSCI(); // Deploy DSC DataScienceCluster dsc = new DataScienceClusterBuilder()