Skip to content

Commit d3941dc

Browse files
committed
Fix an issue in scale down to 0 replica
Signed-off-by: Dongbo Xiao <[email protected]>
1 parent c669a9e commit d3941dc

File tree

1 file changed

+7
-4
lines changed
  • src/main/java/oracle/kubernetes/operator

1 file changed

+7
-4
lines changed

src/main/java/oracle/kubernetes/operator/Main.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ public ListPersistentVolumeClaimStep(Step next) {
524524
@Override
525525
public NextAction apply(Packet packet) {
526526
DomainPresenceInfo info = packet.getSPI(DomainPresenceInfo.class);
527-
527+
528528
Domain dom = info.getDomain();
529529
V1ObjectMeta meta = dom.getMetadata();
530530
DomainSpec spec = dom.getSpec();
@@ -717,6 +717,10 @@ public NextAction apply(Packet packet) {
717717
for (WlsServerConfig wlsServerConfig : wlsClusterConfig.getServerConfigs()) {
718718
String serverName = wlsServerConfig.getName();
719719
if (!serverName.equals(asName) && !servers.contains(serverName)) {
720+
// done with the current cluster
721+
if (startedCount >= cs.getReplicas() && !startAll)
722+
continue cluster;
723+
720724
List<V1EnvVar> env = cs.getEnv();
721725
ServerStartup ssi = null;
722726
ssl = spec.getServerStartup();
@@ -736,8 +740,7 @@ public NextAction apply(Packet packet) {
736740
env = startInAdminMode(env);
737741
}
738742
ssic.add(new ServerStartupInfo(wlsServerConfig, wlsClusterConfig, env, ssi));
739-
if (++startedCount >= cs.getReplicas() && !startAll)
740-
continue cluster;
743+
startedCount++;
741744
}
742745
}
743746
}
@@ -1371,4 +1374,4 @@ public static Collection<NetworkAccessPoint> adminChannelsToCreate(WlsDomainConf
13711374
LOGGER.exiting();
13721375
return validatedChannels;
13731376
}
1374-
}
1377+
}

0 commit comments

Comments
 (0)