Skip to content

Commit e1cc360

Browse files
authored
Merge pull request kubernetes#87002 from SataQiu/staticcheck-20200109
Fix staticcheck failures of pkg/util/ipconfig pkg/util/iptables pkg/util/ipvs/testing
2 parents 3e8155e + 51c742c commit e1cc360

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

hack/.staticcheck_failures

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ pkg/registry/core/service/ipallocator
2020
pkg/registry/core/service/portallocator
2121
pkg/registry/core/service/storage
2222
pkg/util/coverage
23-
pkg/util/ipconfig
24-
pkg/util/iptables
25-
pkg/util/ipvs/testing
2623
pkg/util/netsh
2724
pkg/volume
2825
pkg/volume/awsebs

pkg/util/ipconfig/ipconfig.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package ipconfig
1919
import (
2020
"runtime"
2121
"strings"
22-
"sync"
2322

2423
"k8s.io/klog"
2524

@@ -42,7 +41,6 @@ const (
4241

4342
// runner implements Interface in terms of exec("ipconfig").
4443
type runner struct {
45-
mu sync.Mutex
4644
exec utilexec.Interface
4745
}
4846

pkg/util/iptables/iptables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ func iptablesCommand(protocol Protocol) string {
432432
}
433433

434434
func (runner *runner) run(op operation, args []string) ([]byte, error) {
435-
return runner.runContext(nil, op, args)
435+
return runner.runContext(context.TODO(), op, args)
436436
}
437437

438438
func (runner *runner) runContext(ctx context.Context, op operation, args []string) ([]byte, error) {

pkg/util/ipvs/testing/fake_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ func TestVirtualServer(t *testing.T) {
5858
}
5959
// Check the updated virtual server
6060
got12, err := fake.GetVirtualServer(vs1)
61+
if err != nil {
62+
t.Errorf("Fail to get virtual server, error: %v", err)
63+
}
6164
if !got12.Equal(vs12) {
6265
t.Errorf("Expect virtual server: %v, got: %v", vs12, got12)
6366
}

0 commit comments

Comments
 (0)