Skip to content

Commit 03831e7

Browse files
authored
Merge pull request #101 from oracle/doxiao/scale-down-to-zero
Fix an issue in scale down to 0 replica
2 parents 0573705 + d3941dc commit 03831e7

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
@@ -527,7 +527,7 @@ public ListPersistentVolumeClaimStep(Step next) {
527527
@Override
528528
public NextAction apply(Packet packet) {
529529
DomainPresenceInfo info = packet.getSPI(DomainPresenceInfo.class);
530-
530+
531531
Domain dom = info.getDomain();
532532
V1ObjectMeta meta = dom.getMetadata();
533533
DomainSpec spec = dom.getSpec();
@@ -720,6 +720,10 @@ public NextAction apply(Packet packet) {
720720
for (WlsServerConfig wlsServerConfig : wlsClusterConfig.getServerConfigs()) {
721721
String serverName = wlsServerConfig.getName();
722722
if (!serverName.equals(asName) && !servers.contains(serverName)) {
723+
// done with the current cluster
724+
if (startedCount >= cs.getReplicas() && !startAll)
725+
continue cluster;
726+
723727
List<V1EnvVar> env = cs.getEnv();
724728
ServerStartup ssi = null;
725729
ssl = spec.getServerStartup();
@@ -739,8 +743,7 @@ public NextAction apply(Packet packet) {
739743
env = startInAdminMode(env);
740744
}
741745
ssic.add(new ServerStartupInfo(wlsServerConfig, wlsClusterConfig, env, ssi));
742-
if (++startedCount >= cs.getReplicas() && !startAll)
743-
continue cluster;
746+
startedCount++;
744747
}
745748
}
746749
}
@@ -1374,4 +1377,4 @@ public static Collection<NetworkAccessPoint> adminChannelsToCreate(WlsDomainConf
13741377
LOGGER.exiting();
13751378
return validatedChannels;
13761379
}
1377-
}
1380+
}

0 commit comments

Comments
 (0)