Skip to content

Commit e132eec

Browse files
committed
Merge branch 'fix-readinessfailed-and-notrolling-update-main' into 'main'
The is a forward port from 4.2 when the readiness probe has a permanent... See merge request weblogic-cloud/weblogic-kubernetes-operator!4866
2 parents b40342d + 49768bf commit e132eec

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ public static boolean isReady(V1Pod pod) {
116116
return ready;
117117
}
118118

119+
/**
120+
* Is the pod waiting to roll.
121+
* @param pod pod
122+
* @return true if the pod is waiting to roll
123+
*/
124+
public static boolean isWaitingToRoll(V1Pod pod) {
125+
return Optional.ofNullable(pod)
126+
.map(V1Pod::getMetadata)
127+
.map(V1ObjectMeta::getAnnotations)
128+
.map(labels -> "true".equalsIgnoreCase(labels.get(LabelConstants.TO_BE_ROLLED_LABEL)))
129+
.orElse(false);
130+
}
131+
119132
static boolean hasReadyServer(V1Pod pod) {
120133
return Optional.ofNullable(pod).map(PodHelper::hasReadyStatus).orElse(false);
121134
}

operator/src/main/java/oracle/kubernetes/operator/steps/ManagedServerUpIteratorStep.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ static class ManagedPodReadyStep extends Step {
148148
WlsDomainConfig domainTopology =
149149
(WlsDomainConfig) packet.get(ProcessingConstants.DOMAIN_TOPOLOGY);
150150
V1Pod managedPod = info.getServerPod(serverName);
151-
152-
if (managedPod == null || (!isPodReady(managedPod) && !isPodMarkedForShutdown(managedPod))) {
151+
boolean isWaitingToRoll = PodHelper.isWaitingToRoll(managedPod);
152+
if (managedPod == null || (!isPodReady(managedPod) && !isPodMarkedForShutdown(managedPod)
153+
&& !isWaitingToRoll)) {
153154
// requeue to wait for managed pod to be ready
154155
return doRequeue(packet);
155156
}

operator/src/main/java/oracle/kubernetes/operator/steps/ShutdownManagedServerStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static Step createShutdownManagedServerStep(Step next, String serverName,
8585
V1Service service = getDomainPresenceInfo(packet).getServerService(serverName);
8686

8787
String now = OffsetDateTime.now().toString();
88-
if (service == null || !PodHelper.isReady(pod) || PodHelper.isFailed(pod)) {
88+
if (service == null || !PodHelper.isReady(pod) || PodHelper.isFailed(pod) || PodHelper.isWaitingToRoll(pod)) {
8989
return doNext(PodHelper.annotatePodAsNeedingToShutdown(pod, now, getNext()), packet);
9090
}
9191
return doNext(

0 commit comments

Comments
 (0)