Skip to content

Commit 74c4d65

Browse files
committed
Merge branch 'failed-job' into 'main'
Ensure that failed status is created for introspector job See merge request weblogic-cloud/weblogic-kubernetes-operator!4734
2 parents c2572ad + d048ce1 commit 74c4d65

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public Result onSuccess(Packet packet, KubernetesApiResponse<T> callResponse) {
239239
packet.put(DOMAIN_INTROSPECTOR_JOB, job);
240240
}
241241

242-
if (isKnownFailedJob(job) || JobWatcher.isJobTimedOut(job) || isInProgressJobOutdated(job)) {
242+
if (isInProgressJobOutdated(job)) {
243243
return doNext(cleanUpAndReintrospect(getNext()), packet);
244244
} else if (job != null) {
245245
return doNext(processExistingIntrospectorJob(getNext()), packet);
@@ -332,20 +332,6 @@ String getIntrospectVersionLabelFromJob(V1Job job) {
332332
.orElse(null);
333333
}
334334

335-
private boolean isKnownFailedJob(V1Job job) {
336-
return getUid(job).equals(getLastFailedUid());
337-
}
338-
339-
@Nonnull
340-
private String getUid(V1Job job) {
341-
return Optional.ofNullable(job).map(V1Job::getMetadata).map(V1ObjectMeta::getUid).orElse("");
342-
}
343-
344-
@Nullable
345-
private String getLastFailedUid() {
346-
return getDomain().getOrCreateStatus().getFailedIntrospectionUid();
347-
}
348-
349335
private boolean isIntrospectionNeeded(Packet packet) {
350336
return getDomainTopology() == null
351337
|| isBringingUpNewDomain(packet)

operator/src/main/java/oracle/kubernetes/operator/watcher/JobWatcher.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,6 @@ private String getJobName(Watch.Response<V1Job> item) {
208208
return item.object.getMetadata().getName();
209209
}
210210

211-
public static boolean isJobTimedOut(V1Job job) {
212-
return isFailed(job) && ("DeadlineExceeded".equals(getFailedReason(job)));
213-
}
214-
215211
public static class DeadlineExceededException extends Exception implements IntrospectionJobHolder {
216212
@Serial
217213
private static final long serialVersionUID = 1L;

operator/src/main/java/oracle/kubernetes/weblogic/domain/model/DomainStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ public DomainConditionFailureInfo getFailureInfo() {
733733
public DomainCondition createAdjustedFailedCondition(DomainFailureReason reason, String message,
734734
boolean isInitDomainOnPV, DomainSpec spec) {
735735
DomainFailureReason effectiveReason = reason;
736-
String effectiveMessage = message;
736+
String effectiveMessage = Optional.ofNullable(message).orElse("");
737737
if (hasJustGotFatalIntrospectorError(effectiveMessage)
738738
|| initDomainOnPVIntropsectionFailure(reason, isInitDomainOnPV)) {
739739
effectiveReason = ABORTED;

0 commit comments

Comments
 (0)