mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
remove redundant condition
This commit is contained in:
parent
da81f24323
commit
c76cd49da1
@ -638,14 +638,13 @@ func TestDeletePods(t *testing.T) {
|
|||||||
if _, ok := ifHasBeenCalled[name]; !ok {
|
if _, ok := ifHasBeenCalled[name]; !ok {
|
||||||
ifHasBeenCalled[name] = true
|
ifHasBeenCalled[name] = true
|
||||||
return &oldPod, nil
|
return &oldPod, nil
|
||||||
} else {
|
|
||||||
if oldPod.ObjectMeta.Generation < 4 {
|
|
||||||
newPod := newPodMap[name]
|
|
||||||
return &newPod, nil
|
|
||||||
} else {
|
|
||||||
return nil, apierrors.NewNotFound(schema.GroupResource{Resource: "pods"}, name)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if oldPod.ObjectMeta.Generation < 4 {
|
||||||
|
newPod := newPodMap[name]
|
||||||
|
return &newPod, nil
|
||||||
|
}
|
||||||
|
return nil, apierrors.NewNotFound(schema.GroupResource{Resource: "pods"}, name)
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, apierrors.NewNotFound(schema.GroupResource{Resource: "pods"}, name)
|
return nil, apierrors.NewNotFound(schema.GroupResource{Resource: "pods"}, name)
|
||||||
},
|
},
|
||||||
@ -662,7 +661,7 @@ func TestDeletePods(t *testing.T) {
|
|||||||
if oldPod, found := oldPodMap[name]; found {
|
if oldPod, found := oldPodMap[name]; found {
|
||||||
return &oldPod, nil
|
return &oldPod, nil
|
||||||
}
|
}
|
||||||
return nil, errors.New(fmt.Sprintf("%q: not found", name))
|
return nil, fmt.Errorf("%q: not found", name)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user