Merge pull request #7899 from sseago/no-fast-fail-for-unschedulable
Don't consider unschedulable pods unrecoverablepull/7922/head
commit
b0dc189311
|
@ -0,0 +1 @@
|
|||
Don't consider unschedulable pods unrecoverable
|
|
@ -642,14 +642,7 @@ func TestPeekExpose(t *testing.T) {
|
|||
Name: backup.Name,
|
||||
},
|
||||
Status: corev1.PodStatus{
|
||||
Phase: corev1.PodPending,
|
||||
Conditions: []corev1.PodCondition{
|
||||
{
|
||||
Type: corev1.PodScheduled,
|
||||
Reason: "Unschedulable",
|
||||
Message: "unrecoverable",
|
||||
},
|
||||
},
|
||||
Phase: corev1.PodFailed,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -679,7 +672,7 @@ func TestPeekExpose(t *testing.T) {
|
|||
kubeClientObj: []runtime.Object{
|
||||
backupPodUrecoverable,
|
||||
},
|
||||
err: "Pod is unschedulable: unrecoverable",
|
||||
err: "Pod is in abnormal state Failed",
|
||||
},
|
||||
{
|
||||
name: "succeed",
|
||||
|
|
|
@ -429,14 +429,7 @@ func TestRestorePeekExpose(t *testing.T) {
|
|||
Name: restore.Name,
|
||||
},
|
||||
Status: corev1api.PodStatus{
|
||||
Phase: corev1api.PodPending,
|
||||
Conditions: []corev1api.PodCondition{
|
||||
{
|
||||
Type: corev1api.PodScheduled,
|
||||
Reason: "Unschedulable",
|
||||
Message: "unrecoverable",
|
||||
},
|
||||
},
|
||||
Phase: corev1api.PodFailed,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -463,7 +456,7 @@ func TestRestorePeekExpose(t *testing.T) {
|
|||
kubeClientObj: []runtime.Object{
|
||||
restorePodUrecoverable,
|
||||
},
|
||||
err: "Pod is unschedulable: unrecoverable",
|
||||
err: "Pod is in abnormal state Failed",
|
||||
},
|
||||
{
|
||||
name: "succeed",
|
||||
|
|
|
@ -121,14 +121,7 @@ func IsPodUnrecoverable(pod *corev1api.Pod, log logrus.FieldLogger) (bool, strin
|
|||
return true, fmt.Sprintf("Pod is in abnormal state %s", pod.Status.Phase)
|
||||
}
|
||||
|
||||
if pod.Status.Phase == corev1api.PodPending && len(pod.Status.Conditions) > 0 {
|
||||
for _, condition := range pod.Status.Conditions {
|
||||
if condition.Type == corev1api.PodScheduled && condition.Reason == "Unschedulable" {
|
||||
log.Warnf("Pod is unschedulable %s", condition.Message)
|
||||
return true, fmt.Sprintf("Pod is unschedulable: %s", condition.Message)
|
||||
}
|
||||
}
|
||||
}
|
||||
// removed "Unschedulable" check since unschedulable condition isn't always permanent
|
||||
|
||||
// Check the Status field
|
||||
for _, containerStatus := range pod.Status.ContainerStatuses {
|
||||
|
|
|
@ -401,21 +401,6 @@ func TestIsPodUnrecoverable(t *testing.T) {
|
|||
},
|
||||
want: false,
|
||||
},
|
||||
{
|
||||
name: "pod is unschedulable",
|
||||
pod: &corev1api.Pod{
|
||||
Status: corev1api.PodStatus{
|
||||
Phase: corev1api.PodPending,
|
||||
Conditions: []corev1api.PodCondition{
|
||||
{
|
||||
Type: corev1api.PodScheduled,
|
||||
Reason: "Unschedulable",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
want: true,
|
||||
},
|
||||
{
|
||||
name: "pod is normal",
|
||||
pod: &corev1api.Pod{
|
||||
|
|
Loading…
Reference in New Issue