Skip to content

Commit 7b036b7

Browse files
committed
Check for job status FailureTarget
1 parent d8d5010 commit 7b036b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ private static List<V1JobCondition> getJobConditions(@Nonnull V1Job job) {
165165
}
166166

167167
private static boolean isJobConditionFailed(V1JobCondition jobCondition) {
168-
return "Failed".equals(getType(jobCondition)) && getStatus(jobCondition).equals("True");
168+
return ("FailureTarget".equals(getType(jobCondition)) || "Failed".equals(getType(jobCondition)))
169+
&& getStatus(jobCondition).equals("True");
169170
}
170171

171172
private static String getType(V1JobCondition jobCondition) {
@@ -185,7 +186,8 @@ public static String getFailedReason(V1Job job) {
185186
V1JobStatus status = job.getStatus();
186187
if (status != null && status.getConditions() != null) {
187188
for (V1JobCondition cond : status.getConditions()) {
188-
if ("Failed".equals(cond.getType()) && "True".equals(cond.getStatus())) {
189+
if (("FailureTarget".equals(cond.getType()) || "Failed".equals(cond.getType()))
190+
&& "True".equals(cond.getStatus())) {
189191
return cond.getReason();
190192
}
191193
}

0 commit comments

Comments
 (0)