mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #38181 from tanshanshan/remove-todo
Automatic merge from submit-queue (batch tested with PRs 38181, 38128, 36711) Remove redundant conditional statement <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md 2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md 3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes --> **What this PR does / why we need it**: 1. remove redundant conditional statement 2. replace errors.New(fmt.Sprintf with fmt.Errorf Thanks. **Special notes for your reviewer**: **Release note**: <!-- Steps to write your release note: 1. Use the release-note-* labels to set the release note state (if you have access) 2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. --> ```release-note ```
This commit is contained in:
commit
490151ee50
@ -638,14 +638,13 @@ func TestDeletePods(t *testing.T) {
|
||||
if _, ok := ifHasBeenCalled[name]; !ok {
|
||||
ifHasBeenCalled[name] = true
|
||||
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)
|
||||
},
|
||||
@ -662,7 +661,7 @@ func TestDeletePods(t *testing.T) {
|
||||
if oldPod, found := oldPodMap[name]; found {
|
||||
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