You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
statuses=append(statuses, fmt.Sprintf("container %s is waiting with reason %q and message %q", cs.Name, cs.State.Waiting.Reason, cs.State.Waiting.Message))
statuses=append(statuses, fmt.Sprintf("container %s is terminated with reason %q and message %q", cs.Name, cs.State.Terminated.Reason, cs.State.Terminated.Message))
statuses=append(statuses, fmt.Sprintf("initcontainer %s is waiting with reason %q and message %q", ics.Name, ics.State.Waiting.Reason, ics.State.Waiting.Message))
statuses=append(statuses, fmt.Sprintf("initcontainer %s is terminated with reason %q and message %q", ics.Name, ics.State.Terminated.Reason, ics.State.Terminated.Message))
klog.Errorf("expecting Pod but received event with kind: %s", event.Object.GetObjectKind())
325
+
returnfalse, fmt.Errorf("expecting Pod but received event with kind: %s", event.Object.GetObjectKind())
326
+
}
327
+
switchphase:=p.Status.Phase; phase {
328
+
casecorev1.PodPending:
329
+
klog.V(4).Infof("Pod %s is pending", name)
330
+
// There are two cases at the moment we want to bottle up the waiting message where
331
+
// the details would be lost if we waited until the pod failed.
332
+
// Case 1: "reason: SignatureValidationFailed".
333
+
// The message looks like 'image pull failed for quay.io/openshift-release-dev/ocp-release@sha256:digest because the signature validation failed: Source image rejected: A signature was required, but no signature exists'
334
+
// We do not need Case 1 if https://github.com/kubernetes/kubernetes/pull/127918 lands into OCP.
335
+
// Case 2: "reason: ErrImagePull".
336
+
// The message looks like '...: reading manifest sha256:... in quay.io/openshift-release-dev/ocp-release: manifest unknown'
337
+
// In case those keywords are changed in the future Kubernetes implementation, we will have to follow up accordingly.
338
+
// Otherwise, we will lose these details in the waiting message. It brings no other harms.
klog.Errorf("Pod %s failed at pending with reason %q and message %q and status %s", name, p.Status.Reason, p.Status.Message, strings.Join(statuses, ","))
344
+
returnfalse, fmt.Errorf("pod %s failed at pending with reason %q and message %q and status %s", name, p.Status.Reason, p.Status.Message, strings.Join(statuses, ","))
345
+
}
298
346
returnfalse, nil
299
-
} elseif!done {
300
-
klog.V(2).Infof("Job %s in namespace %s is not ready, continuing to wait.", job.ObjectMeta.Name, job.ObjectMeta.Namespace)
347
+
casecorev1.PodRunning:
348
+
klog.V(4).Infof("Pod %s is running, waiting for its completion ...", name)
klog.Errorf("Pod %s failed with reason %q and message %q and status %s", name, p.Status.Reason, p.Status.Message, strings.Join(statuses, ","))
356
+
returnfalse, fmt.Errorf("pod %s failed with reason %q and message %q and status %s", name, p.Status.Reason, p.Status.Message, strings.Join(statuses, ","))
357
+
default:
358
+
klog.Errorf("Pod %s is with unexpected phase %s", name, phase)
359
+
returnfalse, fmt.Errorf("pod %s is with unexpected phase %s", name, phase)
0 commit comments