Skip to content

Commit a3ab9e4

Browse files
authored
Owls 97601 - Changes to prevent pod roll when upgrading operator 3.3.8 to 3.4 (#2850)
* OWLS-97601 - Changes to prevent pod roll during operator 3.3.8 to 3.4 upgrade.
1 parent d232e37 commit a3ab9e4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

operator/src/main/java/oracle/kubernetes/operator/helpers/PodStepContext.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@
9494
import static oracle.kubernetes.operator.helpers.EventHelper.EventItem.DOMAIN_ROLL_STARTING;
9595
import static oracle.kubernetes.operator.helpers.EventHelper.EventItem.POD_CYCLE_STARTING;
9696
import static oracle.kubernetes.operator.helpers.LegalNames.LEGAL_CONTAINER_PORT_NAME_MAX_LENGTH;
97+
import static oracle.kubernetes.utils.OperatorUtils.isNullOrEmpty;
9798
import static oracle.kubernetes.weblogic.domain.model.Model.DEFAULT_WDT_INSTALL_HOME;
99+
import static oracle.kubernetes.weblogic.domain.model.Model.DEFAULT_WDT_MODEL_HOME;
98100

99101
public abstract class PodStepContext extends BasePodStepContext {
100102

@@ -963,9 +965,13 @@ void addStartupEnvVars(List<V1EnvVar> vars, TuningParameters tuningParameters) {
963965
addEnvVar(vars, ServerEnvVars.AS_SERVICE_NAME, LegalNames.toServerServiceName(getDomainUid(), getAsName()));
964966
Optional.ofNullable(getDataHome()).ifPresent(v -> addEnvVar(vars, ServerEnvVars.DATA_HOME, v));
965967
String wdtInstallHome = getWdtInstallHome();
966-
if (wdtInstallHome != null && !wdtInstallHome.isEmpty() && !wdtInstallHome.equals(DEFAULT_WDT_INSTALL_HOME)) {
968+
if (!isNullOrEmpty(wdtInstallHome) && !wdtInstallHome.equals(DEFAULT_WDT_INSTALL_HOME)) {
967969
addEnvVar(vars, IntrospectorJobEnvVars.WDT_INSTALL_HOME, wdtInstallHome);
968970
}
971+
String modelHome = getModelHome();
972+
if (!isNullOrEmpty(modelHome) && !modelHome.equals(DEFAULT_WDT_MODEL_HOME)) {
973+
addEnvVar(vars, IntrospectorJobEnvVars.WDT_MODEL_HOME, modelHome);
974+
}
969975
Optional.ofNullable(getServerSpec().getAuxiliaryImages()).ifPresent(cm -> addAuxiliaryImageEnv(cm, vars));
970976
addEnvVarIfTrue(mockWls(), vars, "MOCK_WLS");
971977
Optional.ofNullable(getKubernetesPlatform(tuningParameters)).ifPresent(v ->

0 commit comments

Comments
 (0)