@@ -840,7 +840,12 @@ public Result onSuccess(Packet packet, KubernetesApiResponse<V1PodList> callResp
840
840
if (jobPod == null ) {
841
841
return doContinueListOrNext (callResponse , packet , processIntrospectorPodLog (getNext ()));
842
842
} else if (hasImagePullError (jobPod ) || initContainersHaveImagePullError (jobPod )) {
843
- return doNext (cleanUpAndReintrospect (getNext ()), packet );
843
+
844
+ String reason = getImagePullError (jobPod );
845
+ V1Job domainIntrospectorJob = packet .getValue (DOMAIN_INTROSPECTOR_JOB );
846
+ return doNext (Step .chain (
847
+ createIntrospectionFailureSteps (reason , domainIntrospectorJob ),
848
+ cleanUpAndReintrospect (getNext ())), packet );
844
849
} else if (isJobPodTimedOut (jobPod )) {
845
850
// process job pod timed out same way as job timed out, which is to
846
851
// terminate current fiber
@@ -903,13 +908,33 @@ private boolean initContainersHaveImagePullError(V1Pod pod) {
903
908
.map (V1ContainerStateWaiting ::getReason )
904
909
.anyMatch (IntrospectionStatus ::isImagePullError ))
905
910
.orElse (false );
906
-
907
911
}
908
912
909
913
private List <V1ContainerStatus > getInitContainerStatuses (V1Pod pod ) {
910
914
return Optional .ofNullable (pod .getStatus ()).map (V1PodStatus ::getInitContainerStatuses ).orElse (null );
911
915
}
912
916
917
+ private String getImagePullError (V1Pod pod ) {
918
+ String reason = getJobPodContainerWaitingReason (pod );
919
+ if (!IntrospectionStatus .isImagePullError (reason )) {
920
+
921
+ List <V1ContainerStatus > statuses = getInitContainerStatuses (pod );
922
+ if (statuses != null ) {
923
+ for (V1ContainerStatus status : statuses ) {
924
+ if (status != null && status .getState () != null ) {
925
+ V1ContainerStateWaiting waiting = status .getState ().getWaiting ();
926
+ if (waiting != null && waiting .getReason () != null ) {
927
+ if (IntrospectionStatus .isImagePullError (waiting .getReason ())) {
928
+ reason = waiting .getReason ();
929
+ }
930
+ }
931
+ }
932
+ }
933
+ }
934
+ }
935
+ return reason ;
936
+ }
937
+
913
938
private void recordJobPod (Packet packet , V1Pod jobPod ) {
914
939
packet .put (ProcessingConstants .JOB_POD , jobPod );
915
940
}
0 commit comments