diff --git a/src/main/java/io/odh/test/Environment.java b/src/main/java/io/odh/test/Environment.java index 4c27c3cc..c3539c8f 100644 --- a/src/main/java/io/odh/test/Environment.java +++ b/src/main/java/io/odh/test/Environment.java @@ -48,6 +48,7 @@ public class Environment { private static final String SKIP_INSTALL_OPERATOR_DEPS_ENV = "SKIP_INSTALL_OPERATOR_DEPS"; private static final String SKIP_INSTALL_OPERATOR_ENV = "SKIP_INSTALL_OPERATOR"; public static final String SKIP_DEPLOY_DSCI_DSC_ENV = "SKIP_DEPLOY_DSCI_DSC"; + public static final String DEFAULT_DSCI_NAME_ENV = "DEFAULT_DSCI_NAME"; /** * Install bundle files @@ -62,6 +63,7 @@ public class Environment { private static final String OLM_SOURCE_NAME_ENV = "OLM_SOURCE_NAME"; private static final String OLM_SOURCE_NAMESPACE_ENV = "OLM_SOURCE_NAMESPACE"; private static final String OLM_OPERATOR_VERSION_ENV = "OLM_OPERATOR_VERSION"; + private static final String OLM_OPERATOR_NAME_ENV = "OLM_OPERATOR_NAME"; private static final String OLM_OPERATOR_CHANNEL_ENV = "OLM_OPERATOR_CHANNEL"; private static final String OPERATOR_INSTALL_TYPE_ENV = "OPERATOR_INSTALL_TYPE"; private static final String OLM_UPGRADE_STARTING_VERSION_ENV = "OLM_UPGRADE_STARTING_VERSION"; @@ -78,6 +80,7 @@ public class Environment { public static final boolean SKIP_INSTALL_OPERATOR_DEPS = getOrDefault(SKIP_INSTALL_OPERATOR_DEPS_ENV, Boolean::valueOf, false); public static final boolean SKIP_INSTALL_OPERATOR = getOrDefault(SKIP_INSTALL_OPERATOR_ENV, Boolean::valueOf, false); public static final boolean SKIP_DEPLOY_DSCI_DSC = getOrDefault(SKIP_DEPLOY_DSCI_DSC_ENV, Boolean::valueOf, false); + public static final String DEFAULT_DSCI_NAME = getOrDefault(DEFAULT_DSCI_NAME_ENV, String::valueOf, OdhConstants.DEFAULT_DSCI_NAME); // YAML Bundle public static final String INSTALL_FILE_PATH = getOrDefault(INSTALL_FILE_ENV, TestConstants.LATEST_BUNDLE_DEPLOY_FILE); @@ -90,6 +93,7 @@ public class Environment { public static final String OLM_OPERATOR_CHANNEL = getOrDefault(OLM_OPERATOR_CHANNEL_ENV, OdhConstants.OLM_OPERATOR_CHANNEL); public static final String OLM_OPERATOR_VERSION = getOrDefault(OLM_OPERATOR_VERSION_ENV, OdhConstants.OLM_OPERATOR_VERSION); public static final String OLM_UPGRADE_STARTING_VERSION = getOrDefault(OLM_UPGRADE_STARTING_VERSION_ENV, OdhConstants.OLM_UPGRADE_STARTING_OPERATOR_VERSION); + public static final String OLM_OPERATOR_NAME = getOrDefault(OLM_OPERATOR_NAME_ENV, OdhConstants.OLM_OPERATOR_NAME); public static final String OPERATOR_INSTALL_TYPE = getOrDefault(OPERATOR_INSTALL_TYPE_ENV, InstallTypes.BUNDLE.toString()); diff --git a/src/main/java/io/odh/test/OdhConstants.java b/src/main/java/io/odh/test/OdhConstants.java index 21ddaa42..3846ae63 100644 --- a/src/main/java/io/odh/test/OdhConstants.java +++ b/src/main/java/io/odh/test/OdhConstants.java @@ -79,13 +79,13 @@ private OdhConstants() { } 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); // OLM env variables - public static final String OLM_OPERATOR_NAME = getOdhOrRhoai("OLM_OPERATOR_NAME", ODH_OLM_OPERATOR_NAME, RHOAI_OLM_OPERATOR_NAME); + public static final String OLM_OPERATOR_CHANNEL = getOdhOrRhoai("OLM_OPERATOR_CHANNEL", ODH_OLM_OPERATOR_CHANNEL, RHOAI_OLM_OPERATOR_CHANNEL); + public static final String OLM_OPERATOR_NAME = getOdhOrRhoai("OLM_OPERATOR_NAME", OLM_OPERATOR_CHANNEL.equals("odh-nightlies") ? RHOAI_OLM_OPERATOR_NAME : ODH_OLM_OPERATOR_NAME, RHOAI_OLM_OPERATOR_NAME); public static final String OLM_OPERATOR_NAMESPACE = getOdhOrRhoai("OLM_OPERATOR_NAMESPACE", ODH_OLM_OPERATOR_NAMESPACE, RHOAI_OLM_OPERATOR_NAMESPACE); public static final String OLM_OPERATOR_DEPLOYMENT_NAME = getOdhOrRhoai("OLM_OPERATOR_DEPLOYMENT_NAME", ODH_OLM_OPERATOR_DEPLOYMENT_NAME, RHOAI_OLM_OPERATOR_DEPLOYMENT_NAME); public static final String OLM_APP_BUNDLE_PREFIX = getOdhOrRhoai("OLM_APP_BUNDLE_PREFIX", ODH_OLM_APP_BUNDLE_PREFIX, RHOAI_OLM_APP_BUNDLE_PREFIX); public static final String OLM_OPERATOR_VERSION = getOdhOrRhoai("OLM_OPERATOR_VERSION", ODH_OLM_OPERATOR_VERSION, RHOAI_OLM_OPERATOR_VERSION); public static final String OLM_SOURCE_NAME = getOdhOrRhoai("OLM_SOURCE_NAME", ODH_OLM_SOURCE_NAME, RHOAI_OLM_SOURCE_NAME); - public static final String OLM_OPERATOR_CHANNEL = getOdhOrRhoai("OLM_OPERATOR_CHANNEL", ODH_OLM_OPERATOR_CHANNEL, RHOAI_OLM_OPERATOR_CHANNEL); public static final String OLM_UPGRADE_STARTING_OPERATOR_VERSION = getOdhOrRhoai("OLM_UPGRADE_STARTING_OPERATOR_VERSION", ODH_OLM_UPGRADE_STARTING_OPERATOR_VERSION, RHOAI_OLM_UPGRADE_STARTING_OPERATOR_VERSION); private static T getOdhOrRhoai(String var, T odhValue, T rhoaiValue) { diff --git a/src/main/java/io/odh/test/install/OlmInstall.java b/src/main/java/io/odh/test/install/OlmInstall.java index ede4fe47..324f009c 100644 --- a/src/main/java/io/odh/test/install/OlmInstall.java +++ b/src/main/java/io/odh/test/install/OlmInstall.java @@ -27,13 +27,13 @@ public class OlmInstall { private String namespace = OdhConstants.OLM_OPERATOR_NAMESPACE; private String channel = Environment.OLM_OPERATOR_CHANNEL; - private String name = OdhConstants.OLM_OPERATOR_NAME; - private String operatorName = OdhConstants.OLM_OPERATOR_NAME; + private String name = Environment.OLM_OPERATOR_NAME; + private String operatorName = Environment.OLM_OPERATOR_NAME; private String sourceName = Environment.OLM_SOURCE_NAME; private String sourceNamespace = Environment.OLM_SOURCE_NAMESPACE; private String startingCsv; private String deploymentName = OdhConstants.OLM_OPERATOR_DEPLOYMENT_NAME; - private String olmAppBundlePrefix = OdhConstants.OLM_OPERATOR_NAME; + private String olmAppBundlePrefix = Environment.OLM_OPERATOR_NAME; private String operatorVersion = Environment.OLM_OPERATOR_VERSION; private String csvName = operatorName + "." + operatorVersion; @@ -61,7 +61,7 @@ public void createManual() { * Creates namespace for operator-group and subscription */ private void createNamespace() { - // Create namespace at first because operator-group and subscription could you specific namespace + // Create a namespace first because operator-group and subscription could use specific namespace Namespace ns = new NamespaceBuilder() .withNewMetadata() .withName(namespace) diff --git a/src/main/java/io/odh/test/utils/DscUtils.java b/src/main/java/io/odh/test/utils/DscUtils.java index ed1af1b7..ad91c899 100644 --- a/src/main/java/io/odh/test/utils/DscUtils.java +++ b/src/main/java/io/odh/test/utils/DscUtils.java @@ -4,6 +4,7 @@ */ package io.odh.test.utils; +import io.odh.test.Environment; import io.odh.test.OdhConstants; import io.odh.test.framework.manager.requirements.ServiceMeshOperator; import io.opendatahub.datasciencecluster.v1.DataScienceCluster; @@ -37,7 +38,7 @@ public class DscUtils { public static DSCInitialization getBasicDSCI() { return new DSCInitializationBuilder() .withNewMetadata() - .withName(OdhConstants.DEFAULT_DSCI_NAME) + .withName(Environment.DEFAULT_DSCI_NAME) .endMetadata() .withNewSpec() .withApplicationsNamespace(OdhConstants.CONTROLLERS_NAMESPACE) 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 3f45ed3b..c3e40435 100644 --- a/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java +++ b/src/test/java/io/odh/test/e2e/standard/DataScienceClusterST.java @@ -80,7 +80,8 @@ void createDataScienceCluster() { // Create DSC DataScienceCluster c = DscUtils.getBasicDSC(DS_PROJECT_NAME); - KubeResourceManager.getInstance().createResourceWithWait(dsci); + // odh-nightly gives us a default DSCi, update that + KubeResourceManager.getInstance().createOrUpdateResourceWithWait(dsci); KubeResourceManager.getInstance().createResourceWithWait(c); DataScienceCluster cluster = DataScienceClusterType.dataScienceCLusterClient().withName(DS_PROJECT_NAME).get();