Skip to content

Commit c409446

Browse files
authored
Merge pull request kubernetes#86781 from SataQiu/staticcheck-20200102
Fix staticcheck failures of test/integration/client test/integration/disruption
2 parents f497c4d + 17b0b77 commit c409446

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

hack/.staticcheck_failures

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ test/e2e/autoscaling
5959
test/e2e/instrumentation/logging/stackdriver
6060
test/e2e/instrumentation/monitoring
6161
test/integration/auth
62-
test/integration/client
6362
test/integration/deployment
64-
test/integration/disruption
6563
test/integration/etcd
6664
test/integration/examples
6765
test/integration/framework

test/integration/client/client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func TestAtomicPut(t *testing.T) {
179179
tmpRC.Spec.Selector[l] = v
180180
tmpRC.Spec.Template.Labels[l] = v
181181
}
182-
tmpRC, err = rcs.Update(tmpRC)
182+
_, err = rcs.Update(tmpRC)
183183
if err != nil {
184184
if apierrors.IsConflict(err) {
185185
// This is what we expect.
@@ -226,7 +226,7 @@ func TestPatch(t *testing.T) {
226226
},
227227
}
228228
pods := c.CoreV1().Pods("default")
229-
pod, err := pods.Create(&podBody)
229+
_, err := pods.Create(&podBody)
230230
if err != nil {
231231
t.Fatalf("Failed creating patchpods: %v", err)
232232
}
@@ -285,7 +285,7 @@ func TestPatch(t *testing.T) {
285285
if err != nil {
286286
t.Fatalf("Failed updating patchpod with patch type %s: %v", k, err)
287287
}
288-
pod, err = pods.Get(name, metav1.GetOptions{})
288+
pod, err := pods.Get(name, metav1.GetOptions{})
289289
if err != nil {
290290
t.Fatalf("Failed getting patchpod: %v", err)
291291
}

test/integration/disruption/disruption_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ func TestPDBWithScaleSubresource(t *testing.T) {
163163
waitPDBStable(t, clientSet, 4, nsName, pdb.Name)
164164

165165
newPdb, err := clientSet.PolicyV1beta1().PodDisruptionBudgets(nsName).Get(pdb.Name, metav1.GetOptions{})
166+
if err != nil {
167+
t.Errorf("Error getting PodDisruptionBudget: %v", err)
168+
}
166169

167170
if expected, found := int32(replicas), newPdb.Status.ExpectedPods; expected != found {
168171
t.Errorf("Expected %d, but found %d", expected, found)

0 commit comments

Comments
 (0)