Skip to content

Commit 318b7df

Browse files
committed
First code changes based on code review
1 parent 3de9d88 commit 318b7df

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

integration-tests/src/test/java/oracle/weblogic/domain/Istio.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ public class Istio {
1818
@ApiModelProperty("The WebLogic readiness port for Istio. Defaults to 8888. Not required.")
1919
private Integer readinessPort;
2020

21-
public static Integer DEFAULT_REPLICATION_PORT = 4358;
21+
public static Integer DEFAULT_REPLICATION_PORT = 4564;
2222

2323
@ApiModelProperty("The operator will create a WebLogic network access point with this port that will then be exposed "
2424
+ "from the container running the WebLogic Server instance. The WebLogic Replication Service will use this "
25-
+ "network access point for all replication traffic. Defaults to 4358.")
25+
+ "network access point for all replication traffic. Defaults to 4564.")
2626
private Integer replicationChannelPort = DEFAULT_REPLICATION_PORT;
2727

2828
@ApiModelProperty("Starting with Istio 1.10, the networking behavior was changed in that the proxy no "

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import oracle.kubernetes.weblogic.domain.model.DomainSpec;
4646
import oracle.kubernetes.weblogic.domain.model.DomainStatus;
4747
import oracle.kubernetes.weblogic.domain.model.IntrospectorJobEnvVars;
48+
import oracle.kubernetes.weblogic.domain.model.Istio;
4849
import oracle.kubernetes.weblogic.domain.model.Server;
4950
import oracle.kubernetes.weblogic.domain.model.ServerEnvVars;
5051
import org.jetbrains.annotations.Nullable;
@@ -335,8 +336,17 @@ List<V1EnvVar> getConfiguredEnvVars(TuningParameters tuningParameters) {
335336
addEnvVar(vars, IntrospectorJobEnvVars.ISTIO_READINESS_PORT, Integer.toString(getIstioReadinessPort()));
336337
addEnvVar(vars, IntrospectorJobEnvVars.ISTIO_POD_NAMESPACE, getNamespace());
337338
if (isIstioEnabled()) {
338-
addEnvVar(vars, IntrospectorJobEnvVars.ISTIO_VERSION, getIstioVersion());
339-
addEnvVar(vars, IntrospectorJobEnvVars.ISTIO_REPLICATION_PORT, Integer.toString(getIstioReplicationPort()));
339+
// Only add the following Istio configuration environment variables when explicitly configured
340+
// otherwise the introspection job will needlessly run, after operator upgrade, based on generated
341+
// hash code of the set of environment variables.
342+
String istioVersion = getIstioVersion();
343+
if (istioVersion != null && !istioVersion.isEmpty()) {
344+
addEnvVar(vars, IntrospectorJobEnvVars.ISTIO_VERSION, getIstioVersion());
345+
}
346+
347+
if (getIstioReplicationPort() != Istio.DEFAULT_REPLICATION_PORT) {
348+
addEnvVar(vars, IntrospectorJobEnvVars.ISTIO_REPLICATION_PORT, Integer.toString(getIstioReplicationPort()));
349+
}
340350
}
341351
if (isUseOnlineUpdate()) {
342352
addEnvVar(vars, IntrospectorJobEnvVars.MII_USE_ONLINE_UPDATE, "true");

operator/src/main/java/oracle/kubernetes/weblogic/domain/model/IntrospectorJobEnvVars.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static boolean isReserved(String name) {
159159
private static final List<String> RESERVED_NAMES = Arrays.asList(
160160
NAMESPACE, INTROSPECT_HOME, CREDENTIALS_SECRET_NAME, OPSS_KEY_SECRET_NAME, OPSS_WALLETFILE_SECRET_NAME,
161161
RUNTIME_ENCRYPTION_SECRET_NAME, WDT_DOMAIN_TYPE, DOMAIN_SOURCE_TYPE, ISTIO_ENABLED, ISTIO_READINESS_PORT,
162-
ISTIO_REPLICATION_PORT, ISTIO_VERSION, ISTIO_POD_NAMESPACE, WDT_MODEL_HOME, MII_USE_ONLINE_UPDATE,
162+
ISTIO_POD_NAMESPACE, WDT_MODEL_HOME, MII_USE_ONLINE_UPDATE,
163163
MII_COMMIT_AND_ROLL, MII_COMMIT_ONLY, MII_WDT_CONNECT_TIMEOUT, MII_WDT_ACTIVATE_TIMEOUT, MII_WDT_DEPLOY_TIMEOUT,
164164
MII_WDT_REDEPLOY_TIMEOUT, MII_WDT_UNDEPLOY_TIMEOUT, MII_WDT_START_APPLICATION_TIMEOUT,
165165
MII_WDT_STOP_APPLICAITON_TIMEOUT, MII_WDT_SET_SERVERGROUPS_TIMEOUT,

0 commit comments

Comments
 (0)