Skip to content

Commit ab4b15e

Browse files
authored
OWLS-90971 - Fix for admin server restart when Domain CR patched with incorrect auxiliary image command. (#2465)
* OWLS-90971 - Fix for admin server restart when Domain CR patched with incorrect auxiliary image command. * Rename method and introduce constant.
1 parent cb6901d commit ab4b15e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAuxiliaryImage.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import static oracle.weblogic.kubernetes.assertions.TestAssertions.secretExists;
6464
import static oracle.weblogic.kubernetes.assertions.TestAssertions.verifyRollingRestartOccurred;
6565
import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.createDomainResource;
66+
import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.verifyPodsNotRolled;
6667
import static oracle.weblogic.kubernetes.utils.CommonPatchTestUtils.patchDomainResource;
6768
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkDomainEventContainsExpectedMsg;
6869
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodDoesNotExist;
@@ -708,16 +709,13 @@ public void testErrorPathDomainWithFailCustomMountCommand() {
708709
checkPodLogContainsString(opNamespace, operatorPodName, expectedErrorMsg);
709710

710711
// verify the domain is not rolled
711-
// TODO: enable this check once https://jira.oraclecorp.com/jira/browse/OWLS-90971 is fixed
712-
/*
713712
logger.info("sleep 2 minutes to make sure the domain is not restarted");
714713
try {
715714
Thread.sleep(120000);
716715
} catch (InterruptedException ie) {
717716
// ignore
718717
}
719718
verifyPodsNotRolled(domainNamespace, pods);
720-
*/
721719

722720
// restore domain1
723721
// patch the first auxiliary image to remove the domain.spec.serverPod.auxiliaryImages.command

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import static oracle.kubernetes.operator.DomainStatusUpdater.createProgressingStartedEventStep;
5858
import static oracle.kubernetes.operator.LabelConstants.INTROSPECTION_DOMAIN_SPEC_GENERATION;
5959
import static oracle.kubernetes.operator.LabelConstants.INTROSPECTION_STATE_LABEL;
60+
import static oracle.kubernetes.operator.ProcessingConstants.DOMAIN_INTROSPECT_REQUESTED;
6061
import static oracle.kubernetes.operator.logging.MessageKeys.INTROSPECTOR_JOB_FAILED;
6162
import static oracle.kubernetes.operator.logging.MessageKeys.INTROSPECTOR_JOB_FAILED_DETAIL;
6263

@@ -98,7 +99,7 @@ private static boolean runIntrospector(Packet packet, DomainPresenceInfo info) {
9899
LOGGER.fine("isModelInImageUpdate: " + isModelInImageUpdate(packet, info));
99100
return topology == null
100101
|| isBringingUpNewDomain(packet, info)
101-
|| isIntrospectionRequestedAndRemove(packet)
102+
|| checkIfIntrospectionRequestedAndReset(packet)
102103
|| isModelInImageUpdate(packet, info)
103104
|| isIntrospectVersionChanged(packet, info);
104105
}
@@ -107,8 +108,8 @@ private static boolean isBringingUpNewDomain(Packet packet, DomainPresenceInfo i
107108
return runningServersCount(info) == 0 && creatingServers(info) && isGenerationChanged(packet, info);
108109
}
109110

110-
private static boolean isIntrospectionRequestedAndRemove(Packet packet) {
111-
return packet.remove(ProcessingConstants.DOMAIN_INTROSPECT_REQUESTED) != null;
111+
private static boolean checkIfIntrospectionRequestedAndReset(Packet packet) {
112+
return packet.remove(DOMAIN_INTROSPECT_REQUESTED) != null;
112113
}
113114

114115
private static boolean isIntrospectVersionChanged(Packet packet, DomainPresenceInfo info) {
@@ -506,6 +507,7 @@ private Step readDomainIntrospectorPodLog(String jobPodName, String namespace, S
506507
}
507508

508509
private static class ReadDomainIntrospectorPodLogResponseStep extends ResponseStep<String> {
510+
public static final String INTROSPECTION_FAILED = "INTROSPECTION_FAILED";
509511
private StringBuilder logMessage = new StringBuilder();
510512
private final List<String> severeStatuses = new ArrayList<>();
511513

@@ -552,6 +554,7 @@ public NextAction onSuccess(Packet packet, CallResponse<String> callResponse) {
552554
getJobCreationTime(domainIntrospectorJob).plus(retryIntervalSeconds, SECONDS))) {
553555
//Introspector job is incomplete and current time is greater than the lazy deletion time for the job,
554556
//update the domain status and execute the next step
557+
packet.put(DOMAIN_INTROSPECT_REQUESTED, INTROSPECTION_FAILED);
555558
nextStep = getNext();
556559
}
557560

0 commit comments

Comments
 (0)