fix staticcheck failures of pkg/util/ipconfig pkg/util/iptables pkg/util/ipvs/testing

This commit is contained in:
SataQiu 2020-01-09 16:05:11 +08:00
parent 2c800c5a70
commit 51c742c1dd
4 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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) {

View File

@ -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)
}