Merge pull request #87382 from yiyang5055/fix-staticcheck

fix static check failure in pkg/controller/disruption and pkg/control…
This commit is contained in:
Kubernetes Prow Robot 2020-01-21 06:35:37 -08:00 committed by GitHub
commit 29a4b39536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 10 deletions

View File

@ -2,9 +2,7 @@ cluster/images/etcd-version-monitor
cluster/images/etcd/migrate
pkg/controller/daemon
pkg/controller/deployment
pkg/controller/disruption
pkg/controller/garbagecollector
pkg/controller/namespace/deletion
pkg/controller/nodeipam
pkg/controller/podautoscaler
pkg/controller/podgc

View File

@ -639,12 +639,9 @@ func TestReplicationController(t *testing.T) {
// about the RC. This is a known bug. TODO(mml): file issue
ps.VerifyPdbStatus(t, pdbName, 0, 0, 0, 0, map[string]metav1.Time{})
pods := []*v1.Pod{}
for i := int32(0); i < 3; i++ {
pod, _ := newPod(t, fmt.Sprintf("foobar %d", i))
updatePodOwnerToRc(t, pod, rc)
pods = append(pods, pod)
pod.Labels = labels
add(t, dc.podStore, pod)
dc.sync(pdbName)
@ -680,12 +677,9 @@ func TestStatefulSetController(t *testing.T) {
// about the SS. This is a known bug. TODO(mml): file issue
ps.VerifyPdbStatus(t, pdbName, 0, 0, 0, 0, map[string]metav1.Time{})
pods := []*v1.Pod{}
for i := int32(0); i < 3; i++ {
pod, _ := newPod(t, fmt.Sprintf("foobar %d", i))
updatePodOwnerToSs(t, pod, ss)
pods = append(pods, pod)
pod.Labels = labels
add(t, dc.podStore, pod)
dc.sync(pdbName)

View File

@ -162,7 +162,7 @@ func (d *namespacedResourcesDeleter) initOpCache() {
if len(resources) == 0 {
klog.Fatalf("Unable to get any supported resources from server: %v", err)
}
deletableGroupVersionResources := []schema.GroupVersionResource{}
for _, rl := range resources {
gv, err := schema.ParseGroupVersion(rl.GroupVersion)
if err != nil {
@ -183,7 +183,6 @@ func (d *namespacedResourcesDeleter) initOpCache() {
d.opCache.setNotSupported(operationKey{operation: op, gvr: gvr})
}
}
deletableGroupVersionResources = append(deletableGroupVersionResources, gvr)
}
}
}