|
9 | 9 | import io.kubernetes.client.openapi.models.V1DeleteOptions;
|
10 | 10 | import io.kubernetes.client.openapi.models.V1EnvVar;
|
11 | 11 | import io.kubernetes.client.openapi.models.V1Job;
|
| 12 | +import io.kubernetes.client.openapi.models.V1JobCondition; |
| 13 | +import io.kubernetes.client.openapi.models.V1JobStatus; |
12 | 14 | import io.kubernetes.client.openapi.models.V1Pod;
|
13 | 15 | import io.kubernetes.client.openapi.models.V1PodList;
|
14 | 16 | import io.kubernetes.client.openapi.models.V1Volume;
|
15 | 17 | import io.kubernetes.client.openapi.models.V1VolumeMount;
|
| 18 | +import oracle.kubernetes.operator.DomainStatusUpdater; |
16 | 19 | import oracle.kubernetes.operator.JobWatcher;
|
17 | 20 | import oracle.kubernetes.operator.LabelConstants;
|
18 | 21 | import oracle.kubernetes.operator.ProcessingConstants;
|
@@ -383,7 +386,25 @@ public NextAction onSuccess(Packet packet, CallResponse<String> callResponse) {
|
383 | 386 | V1Job domainIntrospectorJob =
|
384 | 387 | (V1Job) packet.remove(ProcessingConstants.DOMAIN_INTROSPECTOR_JOB);
|
385 | 388 | if (isNotComplete(domainIntrospectorJob)) {
|
386 |
| - return onFailure(packet, callResponse); |
| 389 | + List<String> jobConditionsReason = new ArrayList<>(); |
| 390 | + if (domainIntrospectorJob != null) { |
| 391 | + V1JobStatus status = domainIntrospectorJob.getStatus(); |
| 392 | + if (status != null && status.getConditions() != null) { |
| 393 | + for (V1JobCondition cond : status.getConditions()) { |
| 394 | + jobConditionsReason.add(cond.getReason()); |
| 395 | + } |
| 396 | + } |
| 397 | + } |
| 398 | + if (jobConditionsReason.size() == 0) { |
| 399 | + jobConditionsReason.add(DomainStatusPatch.ERR_INTROSPECTOR); |
| 400 | + } |
| 401 | + //Introspector job is incomplete, update domain status and terminate processing |
| 402 | + return doNext( |
| 403 | + DomainStatusUpdater.createFailedStep( |
| 404 | + onSeparateLines(jobConditionsReason), |
| 405 | + onSeparateLines(severeStatuses), |
| 406 | + null), |
| 407 | + packet); |
387 | 408 | }
|
388 | 409 |
|
389 | 410 | return doNext(packet);
|
|
0 commit comments