Skip to content

Commit 4f252e6

Browse files
committed
Merge branch 'fix-generation-status-update-42' into 'release/4.2'
Fix domainstatus observedGeneration no updated in successful MII online update See merge request weblogic-cloud/weblogic-kubernetes-operator!4965
2 parents bbdaa8d + 2fb9ebc commit 4f252e6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
import static oracle.kubernetes.operator.ProcessingConstants.DOMAIN_TOPOLOGY;
8888
import static oracle.kubernetes.operator.ProcessingConstants.MII_DYNAMIC_UPDATE;
8989
import static oracle.kubernetes.operator.ProcessingConstants.MII_DYNAMIC_UPDATE_RESTART_REQUIRED;
90+
import static oracle.kubernetes.operator.ProcessingConstants.MII_DYNAMIC_UPDATE_SUCCESS;
9091
import static oracle.kubernetes.operator.ProcessingConstants.SERVER_HEALTH_MAP;
9192
import static oracle.kubernetes.operator.ProcessingConstants.SERVER_STATE_MAP;
9293
import static oracle.kubernetes.operator.WebLogicConstants.RUNNING_STATE;
@@ -429,10 +430,12 @@ static class DomainStatusUpdaterContext {
429430
private DomainStatus newStatus;
430431
private final List<EventData> newEvents = new ArrayList<>();
431432
final boolean endOfProcessing;
433+
private Packet packet;
432434

433435
DomainStatusUpdaterContext(Packet packet, DomainStatusUpdaterStep domainStatusUpdaterStep) {
434436
info = DomainPresenceInfo.fromPacket(packet).orElseThrow();
435437
isMakeRight = MakeRightDomainOperation.isMakeRight(packet);
438+
this.packet = packet;
436439
this.domainStatusUpdaterStep = domainStatusUpdaterStep;
437440
endOfProcessing = (Boolean) packet.getOrDefault(ProcessingConstants.END_OF_PROCESSING, Boolean.FALSE);
438441
}
@@ -546,7 +549,10 @@ Step createUpdateSteps(Step next) {
546549
if (!isStatusUnchanged()) {
547550
result.add(createDomainStatusReplaceStep());
548551
} else {
549-
if (endOfProcessing && isMakeRight) {
552+
boolean successFullDynamicUpdate = MII_DYNAMIC_UPDATE_SUCCESS.equals(packet.get(MII_DYNAMIC_UPDATE))
553+
|| MII_DYNAMIC_UPDATE_RESTART_REQUIRED.equals(packet.get(MII_DYNAMIC_UPDATE));
554+
555+
if ((endOfProcessing && isMakeRight) || successFullDynamicUpdate) {
550556
Optional.ofNullable(createDomainStatusObservedGenerationReplaceStep()).ifPresent(result::add);
551557
}
552558
}

0 commit comments

Comments
 (0)