mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
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:
commit
e1cc36000f
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user