Merge pull request #87002 from SataQiu/staticcheck-20200109

Fix staticcheck failures of pkg/util/ipconfig pkg/util/iptables pkg/util/ipvs/testing
This commit is contained in:
Kubernetes Prow Robot 2020-01-13 13:58:55 -08:00 committed by GitHub
commit e1cc36000f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
}