diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index c78b6b0ce00..5d9532402a2 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -20,9 +20,6 @@ pkg/registry/core/service/ipallocator pkg/registry/core/service/portallocator pkg/registry/core/service/storage pkg/util/coverage -pkg/util/ipconfig -pkg/util/iptables -pkg/util/ipvs/testing pkg/util/netsh pkg/volume pkg/volume/awsebs diff --git a/pkg/util/ipconfig/ipconfig.go b/pkg/util/ipconfig/ipconfig.go index 5764511602b..cd8ba2951bb 100644 --- a/pkg/util/ipconfig/ipconfig.go +++ b/pkg/util/ipconfig/ipconfig.go @@ -19,7 +19,6 @@ package ipconfig import ( "runtime" "strings" - "sync" "k8s.io/klog" @@ -42,7 +41,6 @@ const ( // runner implements Interface in terms of exec("ipconfig"). type runner struct { - mu sync.Mutex exec utilexec.Interface } diff --git a/pkg/util/iptables/iptables.go b/pkg/util/iptables/iptables.go index 30c6c838161..e1f68be5938 100644 --- a/pkg/util/iptables/iptables.go +++ b/pkg/util/iptables/iptables.go @@ -432,7 +432,7 @@ func iptablesCommand(protocol Protocol) string { } func (runner *runner) run(op operation, args []string) ([]byte, error) { - return runner.runContext(nil, op, args) + return runner.runContext(context.TODO(), op, args) } func (runner *runner) runContext(ctx context.Context, op operation, args []string) ([]byte, error) { diff --git a/pkg/util/ipvs/testing/fake_test.go b/pkg/util/ipvs/testing/fake_test.go index 8bed6fc7825..1d576151bb1 100644 --- a/pkg/util/ipvs/testing/fake_test.go +++ b/pkg/util/ipvs/testing/fake_test.go @@ -58,6 +58,9 @@ func TestVirtualServer(t *testing.T) { } // Check the updated virtual server got12, err := fake.GetVirtualServer(vs1) + if err != nil { + t.Errorf("Fail to get virtual server, error: %v", err) + } if !got12.Equal(vs12) { t.Errorf("Expect virtual server: %v, got: %v", vs12, got12) }