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,
|
Name: backup.Name,
|
||||||
},
|
},
|
||||||
Status: corev1.PodStatus{
|
Status: corev1.PodStatus{
|
||||||
Phase: corev1.PodPending,
|
Phase: corev1.PodFailed,
|
||||||
Conditions: []corev1.PodCondition{
|
|
||||||
{
|
|
||||||
Type: corev1.PodScheduled,
|
|
||||||
Reason: "Unschedulable",
|
|
||||||
Message: "unrecoverable",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -679,7 +672,7 @@ func TestPeekExpose(t *testing.T) {
|
||||||
kubeClientObj: []runtime.Object{
|
kubeClientObj: []runtime.Object{
|
||||||
backupPodUrecoverable,
|
backupPodUrecoverable,
|
||||||
},
|
},
|
||||||
err: "Pod is unschedulable: unrecoverable",
|
err: "Pod is in abnormal state Failed",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "succeed",
|
name: "succeed",
|
||||||
|
|
|
@ -429,14 +429,7 @@ func TestRestorePeekExpose(t *testing.T) {
|
||||||
Name: restore.Name,
|
Name: restore.Name,
|
||||||
},
|
},
|
||||||
Status: corev1api.PodStatus{
|
Status: corev1api.PodStatus{
|
||||||
Phase: corev1api.PodPending,
|
Phase: corev1api.PodFailed,
|
||||||
Conditions: []corev1api.PodCondition{
|
|
||||||
{
|
|
||||||
Type: corev1api.PodScheduled,
|
|
||||||
Reason: "Unschedulable",
|
|
||||||
Message: "unrecoverable",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -463,7 +456,7 @@ func TestRestorePeekExpose(t *testing.T) {
|
||||||
kubeClientObj: []runtime.Object{
|
kubeClientObj: []runtime.Object{
|
||||||
restorePodUrecoverable,
|
restorePodUrecoverable,
|
||||||
},
|
},
|
||||||
err: "Pod is unschedulable: unrecoverable",
|
err: "Pod is in abnormal state Failed",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "succeed",
|
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)
|
return true, fmt.Sprintf("Pod is in abnormal state %s", pod.Status.Phase)
|
||||||
}
|
}
|
||||||
|
|
||||||
if pod.Status.Phase == corev1api.PodPending && len(pod.Status.Conditions) > 0 {
|
// removed "Unschedulable" check since unschedulable condition isn't always permanent
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the Status field
|
// Check the Status field
|
||||||
for _, containerStatus := range pod.Status.ContainerStatuses {
|
for _, containerStatus := range pod.Status.ContainerStatuses {
|
||||||
|
|
|
@ -401,21 +401,6 @@ func TestIsPodUnrecoverable(t *testing.T) {
|
||||||
},
|
},
|
||||||
want: false,
|
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",
|
name: "pod is normal",
|
||||||
pod: &corev1api.Pod{
|
pod: &corev1api.Pod{
|
||||||
|
|
Loading…
Reference in New Issue