diff --git a/cmd/kubeadm/app/cmd/config_test.go b/cmd/kubeadm/app/cmd/config_test.go index 07228692ef6..09c6b7a7261 100644 --- a/cmd/kubeadm/app/cmd/config_test.go +++ b/cmd/kubeadm/app/cmd/config_test.go @@ -197,12 +197,12 @@ func TestConfigImagesListRunWithoutPath(t *testing.T) { func TestImagesPull(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return nil, nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, }, } diff --git a/cmd/kubeadm/app/cmd/phases/reset/cleanupnode_test.go b/cmd/kubeadm/app/cmd/phases/reset/cleanupnode_test.go index 675bfbbfca0..d472c8e8d3e 100644 --- a/cmd/kubeadm/app/cmd/phases/reset/cleanupnode_test.go +++ b/cmd/kubeadm/app/cmd/phases/reset/cleanupnode_test.go @@ -197,12 +197,12 @@ func TestConfigDirCleaner(t *testing.T) { func TestRemoveContainers(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("id1\nid2"), nil }, - func() ([]byte, error) { return []byte(""), nil }, - func() ([]byte, error) { return []byte(""), nil }, - func() ([]byte, error) { return []byte(""), nil }, - func() ([]byte, error) { return []byte(""), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("id1\nid2"), nil, nil }, + func() ([]byte, []byte, error) { return []byte(""), nil, nil }, + func() ([]byte, []byte, error) { return []byte(""), nil, nil }, + func() ([]byte, []byte, error) { return []byte(""), nil, nil }, + func() ([]byte, []byte, error) { return []byte(""), nil, nil }, }, } fexec := fakeexec.FakeExec{ diff --git a/cmd/kubeadm/app/preflight/checks_test.go b/cmd/kubeadm/app/preflight/checks_test.go index fd66fbe28b4..cfc7bd4bb8d 100644 --- a/cmd/kubeadm/app/preflight/checks_test.go +++ b/cmd/kubeadm/app/preflight/checks_test.go @@ -694,8 +694,8 @@ func TestKubeletVersionCheck(t *testing.T) { for _, tc := range cases { t.Run(tc.kubeletVersion, func(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("Kubernetes " + tc.kubeletVersion), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("Kubernetes " + tc.kubeletVersion), nil, nil }, }, } fexec := &fakeexec.FakeExec{ @@ -752,7 +752,7 @@ func TestSetHasItemOrAll(t *testing.T) { func TestImagePullCheck(t *testing.T) { fcmd := fakeexec.FakeCmd{ - RunScript: []fakeexec.FakeRunAction{ + RunScript: []fakeexec.FakeAction{ // Test case 1: img1 and img2 exist, img3 doesn't exist func() ([]byte, []byte, error) { return nil, nil, nil }, func() ([]byte, []byte, error) { return nil, nil, nil }, @@ -763,13 +763,13 @@ func TestImagePullCheck(t *testing.T) { func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Test case1: pull only img3 - func() ([]byte, error) { return nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, // Test case 2: fail to pull image2 and image3 - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} }, - func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} }, }, } diff --git a/cmd/kubeadm/app/preflight/utils_test.go b/cmd/kubeadm/app/preflight/utils_test.go index a7c8dd0ed6d..ac52e481226 100644 --- a/cmd/kubeadm/app/preflight/utils_test.go +++ b/cmd/kubeadm/app/preflight/utils_test.go @@ -47,8 +47,8 @@ func TestGetKubeletVersion(t *testing.T) { for _, tc := range cases { t.Run(tc.output, func(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(tc.output), tc.err }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(tc.output), nil, tc.err }, }, } fexec := &fakeexec.FakeExec{ diff --git a/cmd/kubeadm/app/util/runtime/runtime_test.go b/cmd/kubeadm/app/util/runtime/runtime_test.go index d5143e85f93..49c2d11386d 100644 --- a/cmd/kubeadm/app/util/runtime/runtime_test.go +++ b/cmd/kubeadm/app/util/runtime/runtime_test.go @@ -83,11 +83,11 @@ func genFakeActions(fcmd *fakeexec.FakeCmd, num int) []fakeexec.FakeCommandActio func TestIsRunning(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} }, - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} }, }, } @@ -132,10 +132,10 @@ func TestIsRunning(t *testing.T) { func TestListKubeContainers(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("k8s_p1\nk8s_p2"), nil }, - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, - func() ([]byte, error) { return []byte("k8s_p1\nk8s_p2"), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("k8s_p1\nk8s_p2"), nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return []byte("k8s_p1\nk8s_p2"), nil, nil }, }, } execer := fakeexec.FakeExec{ @@ -178,10 +178,10 @@ func TestListKubeContainers(t *testing.T) { } func TestRemoveContainers(t *testing.T) { - fakeOK := func() ([]byte, error) { return nil, nil } - fakeErr := func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} } + fakeOK := func() ([]byte, []byte, error) { return nil, nil, nil } + fakeErr := func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} } fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ fakeOK, fakeOK, fakeOK, fakeOK, fakeOK, fakeOK, // Test case 1 fakeOK, fakeOK, fakeOK, fakeErr, fakeOK, fakeOK, fakeErr, fakeOK, fakeOK, fakeErr, fakeOK, @@ -227,11 +227,11 @@ func TestRemoveContainers(t *testing.T) { func TestPullImage(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} }, - func() ([]byte, error) { return nil, nil }, - func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, nil }, + func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} }, }, } execer := fakeexec.FakeExec{ @@ -271,7 +271,7 @@ func TestPullImage(t *testing.T) { func TestImageExists(t *testing.T) { fcmd := fakeexec.FakeCmd{ - RunScript: []fakeexec.FakeRunAction{ + RunScript: []fakeexec.FakeAction{ func() ([]byte, []byte, error) { return nil, nil, nil }, func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, func() ([]byte, []byte, error) { return nil, nil, nil }, diff --git a/go.mod b/go.mod index a39fe2c6b10..dab4a1a0831 100644 --- a/go.mod +++ b/go.mod @@ -162,7 +162,7 @@ require ( k8s.io/repo-infra v0.0.1-alpha.1 k8s.io/sample-apiserver v0.0.0 k8s.io/system-validators v1.0.4 - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc sigs.k8s.io/kustomize v2.0.3+incompatible sigs.k8s.io/yaml v1.1.0 ) @@ -553,7 +553,7 @@ replace ( k8s.io/sample-cli-plugin => ./staging/src/k8s.io/sample-cli-plugin k8s.io/sample-controller => ./staging/src/k8s.io/sample-controller k8s.io/system-validators => k8s.io/system-validators v1.0.4 - k8s.io/utils => k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils => k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc modernc.org/cc => modernc.org/cc v1.0.0 modernc.org/golex => modernc.org/golex v1.0.0 modernc.org/mathutil => modernc.org/mathutil v1.0.0 diff --git a/go.sum b/go.sum index eb576911f93..80e94f59171 100644 --- a/go.sum +++ b/go.sum @@ -594,8 +594,8 @@ k8s.io/repo-infra v0.0.1-alpha.1 h1:2us1n30u3cOcoPsacNfCvCssS9B9Yldr1ZGOdK0728U= k8s.io/repo-infra v0.0.1-alpha.1/go.mod h1:wO1t9WaB99V80ljbeENTnayuEEwNZt7gECYh/CEyOJ8= k8s.io/system-validators v1.0.4 h1:sW57tJ/ciqOVbbTLN+ZNy64MJMNqUuiwrirQv8IR2Kw= k8s.io/system-validators v1.0.4/go.mod h1:HgSgTg4NAGNoYYjKsUyk52gdNi2PVDswQ9Iyn66R7NI= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/pkg/kubelet/dockershim/network/cni/cni_test.go b/pkg/kubelet/dockershim/network/cni/cni_test.go index d7253e9b734..ef6009eee29 100644 --- a/pkg/kubelet/dockershim/network/cni/cni_test.go +++ b/pkg/kubelet/dockershim/network/cni/cni_test.go @@ -176,9 +176,9 @@ func TestCNIPlugin(t *testing.T) { fakeCmds := []fakeexec.FakeCommandAction{ func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { - return []byte(podIPOutput), nil + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { + return []byte(podIPOutput), nil, nil }, }, }, cmd, args...) diff --git a/pkg/kubelet/dockershim/network/hairpin/hairpin_test.go b/pkg/kubelet/dockershim/network/hairpin/hairpin_test.go index c749183a26c..eb4c15872e7 100644 --- a/pkg/kubelet/dockershim/network/hairpin/hairpin_test.go +++ b/pkg/kubelet/dockershim/network/hairpin/hairpin_test.go @@ -56,8 +56,8 @@ func TestFindPairInterfaceOfContainerInterface(t *testing.T) { } for _, test := range tests { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(test.output), test.err }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(test.output), nil, test.err }, }, } fexec := fakeexec.FakeExec{ diff --git a/pkg/kubelet/dockershim/network/kubenet/kubenet_linux_test.go b/pkg/kubelet/dockershim/network/kubenet/kubenet_linux_test.go index 2a26b8ebba3..8bd15af4042 100644 --- a/pkg/kubelet/dockershim/network/kubenet/kubenet_linux_test.go +++ b/pkg/kubelet/dockershim/network/kubenet/kubenet_linux_test.go @@ -100,14 +100,14 @@ func TestGetPodNetworkStatus(t *testing.T) { for _, t := range testCases { // the fake commands return the IP from the given index, or an error fCmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { ips, ok := podIPMap[kubecontainer.ContainerID{ID: t.id}] if !ok { - return nil, fmt.Errorf("Pod IP %q not found", t.id) + return nil, nil, fmt.Errorf("Pod IP %q not found", t.id) } ipsList := ips.UnsortedList() - return []byte(ipsList[0]), nil + return []byte(ipsList[0]), nil, nil }, }, } @@ -202,9 +202,9 @@ func TestInit_MTU(t *testing.T) { { // modprobe br-netfilter fCmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { - return make([]byte, 0), nil + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { + return make([]byte, 0), nil, nil }, }, } diff --git a/pkg/proxy/iptables/proxier_test.go b/pkg/proxy/iptables/proxier_test.go index 2139e217676..497fb2260e8 100644 --- a/pkg/proxy/iptables/proxier_test.go +++ b/pkg/proxy/iptables/proxier_test.go @@ -246,7 +246,7 @@ func TestDeleteEndpointConnections(t *testing.T) { } else { simErr = fmt.Errorf(tc.simulatedErr) } - cmdFunc := func() ([]byte, error) { return []byte(cmdOutput), simErr } + cmdFunc := func() ([]byte, []byte, error) { return []byte(cmdOutput), nil, simErr } fcmd.CombinedOutputScript = append(fcmd.CombinedOutputScript, cmdFunc) fexec.CommandScript = append(fexec.CommandScript, execFunc) } diff --git a/pkg/proxy/ipvs/proxier_test.go b/pkg/proxy/ipvs/proxier_test.go index ab49b8f64b3..d83c191b9db 100644 --- a/pkg/proxy/ipvs/proxier_test.go +++ b/pkg/proxy/ipvs/proxier_test.go @@ -98,9 +98,9 @@ func (fake *fakeIPSetVersioner) GetVersion() (string, error) { func NewFakeProxier(ipt utiliptables.Interface, ipvs utilipvs.Interface, ipset utilipset.Interface, nodeIPs []net.IP, excludeCIDRs []*net.IPNet, endpointSlicesEnabled bool) *Proxier { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("dummy device have been created"), nil }, - func() ([]byte, error) { return []byte(""), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("dummy device have been created"), nil, nil }, + func() ([]byte, []byte, error) { return []byte(""), nil, nil }, }, } fexec := &fakeexec.FakeExec{ diff --git a/pkg/proxy/userspace/proxier_test.go b/pkg/proxy/userspace/proxier_test.go index 5ae26b4fbfb..b51cc9d9007 100644 --- a/pkg/proxy/userspace/proxier_test.go +++ b/pkg/proxy/userspace/proxier_test.go @@ -1148,8 +1148,8 @@ func TestNoopEndpointSlice(t *testing.T) { func makeFakeExec() *fakeexec.FakeExec { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, }, } return &fakeexec.FakeExec{ diff --git a/pkg/util/bandwidth/linux_test.go b/pkg/util/bandwidth/linux_test.go index 07aeac73b04..41643af5ecd 100644 --- a/pkg/util/bandwidth/linux_test.go +++ b/pkg/util/bandwidth/linux_test.go @@ -65,8 +65,8 @@ func TestNextClassID(t *testing.T) { } for _, test := range tests { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(test.output), test.err }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(test.output), nil, test.err }, }, } fexec := fakeexec.FakeExec{ @@ -247,8 +247,8 @@ func TestFindCIDRClass(t *testing.T) { } for _, test := range tests { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(test.output), test.err }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(test.output), nil, test.err }, }, } fexec := fakeexec.FakeExec{ @@ -286,8 +286,8 @@ func TestFindCIDRClass(t *testing.T) { func TestGetCIDRs(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(tcFilterOutput), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(tcFilterOutput), nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -351,13 +351,13 @@ func TestLimit(t *testing.T) { for _, test := range tests { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(tcClassOutput), test.err }, - func() ([]byte, error) { return []byte{}, test.err }, - func() ([]byte, error) { return []byte{}, test.err }, - func() ([]byte, error) { return []byte(tcClassOutput2), test.err }, - func() ([]byte, error) { return []byte{}, test.err }, - func() ([]byte, error) { return []byte{}, test.err }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(tcClassOutput), nil, test.err }, + func() ([]byte, []byte, error) { return []byte{}, nil, test.err }, + func() ([]byte, []byte, error) { return []byte{}, nil, test.err }, + func() ([]byte, []byte, error) { return []byte(tcClassOutput2), nil, test.err }, + func() ([]byte, []byte, error) { return []byte{}, nil, test.err }, + func() ([]byte, []byte, error) { return []byte{}, nil, test.err }, }, } @@ -467,10 +467,10 @@ func TestReset(t *testing.T) { } for _, test := range tests { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(tcFilterOutput), test.err }, - func() ([]byte, error) { return []byte{}, test.err }, - func() ([]byte, error) { return []byte{}, test.err }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(tcFilterOutput), nil, test.err }, + func() ([]byte, []byte, error) { return []byte{}, nil, test.err }, + func() ([]byte, []byte, error) { return []byte{}, nil, test.err }, }, } @@ -526,8 +526,8 @@ var tcQdisc = "qdisc htb 1: root refcnt 2 r2q 10 default 30 direct_packets_stat func TestReconcileInterfaceExists(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(tcQdisc), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(tcQdisc), nil, nil }, }, } @@ -564,9 +564,9 @@ func TestReconcileInterfaceExists(t *testing.T) { func testReconcileInterfaceHasNoData(t *testing.T, output string) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(output), nil }, - func() ([]byte, error) { return []byte(output), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(output), nil, nil }, + func() ([]byte, []byte, error) { return []byte(output), nil, nil }, }, } @@ -637,10 +637,10 @@ var tcQdiscWrong = []string{ func TestReconcileInterfaceIsWrong(t *testing.T) { for _, test := range tcQdiscWrong { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(test), nil }, - func() ([]byte, error) { return []byte("\n"), nil }, - func() ([]byte, error) { return []byte("\n"), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(test), nil, nil }, + func() ([]byte, []byte, error) { return []byte("\n"), nil, nil }, + func() ([]byte, []byte, error) { return []byte("\n"), nil, nil }, }, } diff --git a/pkg/util/conntrack/conntrack_test.go b/pkg/util/conntrack/conntrack_test.go index 6f74ea51360..6ceeb510f6b 100644 --- a/pkg/util/conntrack/conntrack_test.go +++ b/pkg/util/conntrack/conntrack_test.go @@ -36,11 +36,11 @@ func familyParamStr(isIPv6 bool) string { func TestExecConntrackTool(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, - func() ([]byte, error) { - return []byte(""), fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, + func() ([]byte, []byte, error) { + return []byte(""), nil, fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") }, }, } @@ -85,13 +85,13 @@ func TestExecConntrackTool(t *testing.T) { func TestClearUDPConntrackForIP(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, - func() ([]byte, error) { - return []byte(""), fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, + func() ([]byte, []byte, error) { + return []byte(""), nil, fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") }, - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -133,12 +133,12 @@ func TestClearUDPConntrackForIP(t *testing.T) { func TestClearUDPConntrackForPort(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, - func() ([]byte, error) { - return []byte(""), fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, + func() ([]byte, []byte, error) { + return []byte(""), nil, fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") }, - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -179,12 +179,12 @@ func TestClearUDPConntrackForPort(t *testing.T) { func TestDeleteUDPConnections(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, - func() ([]byte, error) { - return []byte(""), fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, + func() ([]byte, []byte, error) { + return []byte(""), nil, fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") }, - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -237,12 +237,12 @@ func TestDeleteUDPConnections(t *testing.T) { func TestClearUDPConntrackForPortNAT(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, - func() ([]byte, error) { - return []byte(""), fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, + func() ([]byte, []byte, error) { + return []byte(""), nil, fmt.Errorf("conntrack v1.4.2 (conntrack-tools): 0 flow entries have been deleted") }, - func() ([]byte, error) { return []byte("1 flow entries have been deleted"), nil }, + func() ([]byte, []byte, error) { return []byte("1 flow entries have been deleted"), nil, nil }, }, } fexec := fakeexec.FakeExec{ diff --git a/pkg/util/ebtables/ebtables_test.go b/pkg/util/ebtables/ebtables_test.go index 68094135c22..32ea02572d2 100644 --- a/pkg/util/ebtables/ebtables_test.go +++ b/pkg/util/ebtables/ebtables_test.go @@ -26,17 +26,17 @@ import ( func TestEnsureChain(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Does not Exists - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Exists - func() ([]byte, error) { return nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, nil }, // Does not Exists - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, // Fail to create chain - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 2} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 2} }, }, } fexec := fakeexec.FakeExec{ @@ -78,23 +78,23 @@ func TestEnsureChain(t *testing.T) { func TestEnsureRule(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Exists - func() ([]byte, error) { + func() ([]byte, []byte, error) { return []byte(`Bridge table: filter Bridge chain: OUTPUT, entries: 4, policy: ACCEPT -j TEST -`), nil +`), nil, nil }, // Does not Exists. - func() ([]byte, error) { + func() ([]byte, []byte, error) { return []byte(`Bridge table: filter -Bridge chain: TEST, entries: 0, policy: ACCEPT`), nil +Bridge chain: TEST, entries: 0, policy: ACCEPT`), nil, nil }, // Fail to create - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 2} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 2} }, }, } fexec := fakeexec.FakeExec{ diff --git a/pkg/util/ipset/ipset_test.go b/pkg/util/ipset/ipset_test.go index db041bab6da..3ad5cb70341 100644 --- a/pkg/util/ipset/ipset_test.go +++ b/pkg/util/ipset/ipset_test.go @@ -41,9 +41,9 @@ func TestCheckIPSetVersion(t *testing.T) { for i := range testCases { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // ipset version response - func() ([]byte, error) { return []byte(testCases[i].vstring), nil }, + func() ([]byte, []byte, error) { return []byte(testCases[i].vstring), nil, nil }, }, } @@ -67,11 +67,11 @@ func TestCheckIPSetVersion(t *testing.T) { func TestFlushSet(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -101,12 +101,12 @@ func TestFlushSet(t *testing.T) { func TestDestroySet(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Failure - func() ([]byte, error) { - return []byte("ipset v6.19: The set with the given name does not exist"), &fakeexec.FakeExitError{Status: 1} + func() ([]byte, []byte, error) { + return []byte("ipset v6.19: The set with the given name does not exist"), nil, &fakeexec.FakeExitError{Status: 1} }, }, } @@ -137,11 +137,11 @@ func TestDestroySet(t *testing.T) { func TestDestroyAllSets(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -177,14 +177,14 @@ func TestCreateSet(t *testing.T) { } fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Failure - func() ([]byte, error) { - return []byte("ipset v6.19: Set cannot be created: set with the same name already exists"), &fakeexec.FakeExitError{Status: 1} + func() ([]byte, []byte, error) { + return []byte("ipset v6.19: Set cannot be created: set with the same name already exists"), nil, &fakeexec.FakeExitError{Status: 1} }, }, } @@ -367,14 +367,14 @@ var testCases = []struct { func TestAddEntry(t *testing.T) { for i := range testCases { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Failure - func() ([]byte, error) { - return []byte("ipset v6.19: Set cannot be created: set with the same name already exists"), &fakeexec.FakeExitError{Status: 1} + func() ([]byte, []byte, error) { + return []byte("ipset v6.19: Set cannot be created: set with the same name already exists"), nil, &fakeexec.FakeExitError{Status: 1} }, }, } @@ -419,12 +419,12 @@ func TestAddEntry(t *testing.T) { func TestDelEntry(t *testing.T) { for i := range testCases { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Failure - func() ([]byte, error) { - return []byte("ipset v6.19: Element cannot be deleted from the set: it's not added"), &fakeexec.FakeExitError{Status: 1} + func() ([]byte, []byte, error) { + return []byte("ipset v6.19: Element cannot be deleted from the set: it's not added"), nil, &fakeexec.FakeExitError{Status: 1} }, }, } @@ -463,12 +463,14 @@ func TestTestEntry(t *testing.T) { } setName := "NOT" fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { return []byte("10.120.7.100,tcp:8080 is in set " + setName + "."), nil }, + func() ([]byte, []byte, error) { + return []byte("10.120.7.100,tcp:8080 is in set " + setName + "."), nil, nil + }, // Failure - func() ([]byte, error) { - return []byte("192.168.1.3,tcp:8080 is NOT in set " + setName + "."), &fakeexec.FakeExitError{Status: 1} + func() ([]byte, []byte, error) { + return []byte("192.168.1.3,tcp:8080 is NOT in set " + setName + "."), nil, &fakeexec.FakeExitError{Status: 1} }, }, } @@ -538,10 +540,10 @@ Members: for i := range testCases { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { - return []byte(testCases[i].output), nil + func() ([]byte, []byte, error) { + return []byte(testCases[i].output), nil, nil }, }, } @@ -581,9 +583,9 @@ baz` expected := []string{"foo", "bar", "baz"} fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { return []byte(output), nil }, + func() ([]byte, []byte, error) { return []byte(output), nil, nil }, }, } fexec := fakeexec.FakeExec{ diff --git a/pkg/util/iptables/iptables_test.go b/pkg/util/iptables/iptables_test.go index 7020275381c..1022ba85d65 100644 --- a/pkg/util/iptables/iptables_test.go +++ b/pkg/util/iptables/iptables_test.go @@ -49,11 +49,11 @@ func testIPTablesVersionCmds(t *testing.T, protocol Protocol) { protoStr := protocolStr(protocol) fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version response (for runner instantiation) - func() ([]byte, error) { return []byte(iptablesCmd + version), nil }, + func() ([]byte, []byte, error) { return []byte(iptablesCmd + version), nil, nil }, // iptables-restore version response (for runner instantiation) - func() ([]byte, error) { return []byte(iptablesRestoreCmd + version), nil }, + func() ([]byte, []byte, error) { return []byte(iptablesRestoreCmd + version), nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -87,15 +87,15 @@ func testEnsureChain(t *testing.T, protocol Protocol) { protoStr := protocolStr(protocol) fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Success. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Exists. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, // Failure. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 2} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 2} }, }, } fexec := fakeexec.FakeExec{ @@ -147,13 +147,13 @@ func TestEnsureChainIpv6(t *testing.T) { func TestFlushChain(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Success. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Failure. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -184,13 +184,13 @@ func TestFlushChain(t *testing.T) { func TestDeleteChain(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Success. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Failure. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -221,11 +221,11 @@ func TestDeleteChain(t *testing.T) { func TestEnsureRuleAlreadyExists(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Success. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -254,13 +254,13 @@ func TestEnsureRuleAlreadyExists(t *testing.T) { func TestEnsureRuleNew(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Status 1 on the first call. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, // Success on the second call. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -290,11 +290,11 @@ func TestEnsureRuleNew(t *testing.T) { func TestEnsureRuleErrorChecking(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Status 2 on the first call. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 2} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 2} }, }, } fexec := fakeexec.FakeExec{ @@ -317,13 +317,13 @@ func TestEnsureRuleErrorChecking(t *testing.T) { func TestEnsureRuleErrorCreating(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Status 1 on the first call. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, // Status 1 on the second call. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -347,11 +347,11 @@ func TestEnsureRuleErrorCreating(t *testing.T) { func TestDeleteRuleDoesNotExist(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Status 1 on the first call. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -377,13 +377,13 @@ func TestDeleteRuleDoesNotExist(t *testing.T) { func TestDeleteRuleExists(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Success on the first call. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success on the second call. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -410,11 +410,11 @@ func TestDeleteRuleExists(t *testing.T) { func TestDeleteRuleErrorChecking(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Status 2 on the first call. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 2} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 2} }, }, } fexec := fakeexec.FakeExec{ @@ -437,13 +437,13 @@ func TestDeleteRuleErrorChecking(t *testing.T) { func TestDeleteRuleErrorDeleting(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, // Success on the first call. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Status 1 on the second call. - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -479,9 +479,9 @@ func TestGetIPTablesHasCheckCommand(t *testing.T) { for _, testCase := range testCases { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ - func() ([]byte, error) { return []byte(testCase.Version), nil }, - func() ([]byte, error) { return []byte(testCase.Version), nil }, + CombinedOutputScript: []fakeexec.FakeAction{ + func() ([]byte, []byte, error) { return []byte(testCase.Version), nil, nil }, + func() ([]byte, []byte, error) { return []byte(testCase.Version), nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -538,9 +538,9 @@ COMMIT # Completed on Wed Oct 29 14:56:01 2014` fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success. - func() ([]byte, error) { return []byte(iptablesSaveOutput), nil }, + func() ([]byte, []byte, error) { return []byte(iptablesSaveOutput), nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -581,9 +581,9 @@ COMMIT # Completed on Wed Oct 29 14:56:01 2014` fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success. - func() ([]byte, error) { return []byte(iptablesSaveOutput), nil }, + func() ([]byte, []byte, error) { return []byte(iptablesSaveOutput), nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -633,13 +633,13 @@ func TestIPTablesWaitFlag(t *testing.T) { func TestWaitFlagUnavailable(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.4.19"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.4.19"), nil, nil }, // iptables-restore version check - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -666,13 +666,13 @@ func TestWaitFlagUnavailable(t *testing.T) { func TestWaitFlagOld(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.4.20"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.4.20"), nil, nil }, // iptables-restore version check - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -700,13 +700,13 @@ func TestWaitFlagOld(t *testing.T) { func TestWaitFlagNew(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.4.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.4.22"), nil, nil }, // iptables-restore version check - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -731,13 +731,13 @@ func TestWaitFlagNew(t *testing.T) { func TestWaitIntervalFlagNew(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.6.1"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.6.1"), nil, nil }, // iptables-restore version check - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, // Success. - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -777,11 +777,11 @@ COMMIT stderrOutput := "#STDERR OUTPUT" // SaveInto() should should NOT capture stderr into the buffer fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte(iptablesCmd + version), nil }, + func() ([]byte, []byte, error) { return []byte(iptablesCmd + version), nil, nil }, }, - RunScript: []fakeexec.FakeRunAction{ + RunScript: []fakeexec.FakeAction{ func() ([]byte, []byte, error) { return []byte(output), []byte(stderrOutput), nil }, func() ([]byte, []byte, error) { return nil, []byte(stderrOutput), &fakeexec.FakeExitError{Status: 1} }, }, @@ -842,14 +842,14 @@ func testRestore(t *testing.T, protocol Protocol) { protoStr := protocolStr(protocol) fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte(iptablesCmd + version), nil }, - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return []byte(iptablesCmd + version), nil, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -930,11 +930,11 @@ func TestRestoreIPv6(t *testing.T) { // TestRestoreAll tests only the simplest use case, as flag handling code is already tested in TestRestore func TestRestoreAll(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -971,11 +971,11 @@ func TestRestoreAll(t *testing.T) { // TestRestoreAllWait tests that the "wait" flag is passed to a compatible iptables-restore func TestRestoreAllWait(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.9.22"), nil }, - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return []byte("iptables v1.9.22"), nil, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -1013,13 +1013,13 @@ func TestRestoreAllWait(t *testing.T) { // to an old iptables-restore func TestRestoreAllWaitOldIptablesRestore(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.4.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.4.22"), nil, nil }, // iptables-restore version check - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ @@ -1062,11 +1062,11 @@ func TestRestoreAllWaitOldIptablesRestore(t *testing.T) { // support the --wait argument func TestRestoreAllGrabNewLock(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.4.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.4.22"), nil, nil }, // iptables-restore version check - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -1104,11 +1104,11 @@ func TestRestoreAllGrabNewLock(t *testing.T) { // version that does not support the --wait argument func TestRestoreAllGrabOldLock(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.4.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.4.22"), nil, nil }, // iptables-restore version check - func() ([]byte, error) { return []byte{}, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, }, } fexec := fakeexec.FakeExec{ @@ -1141,13 +1141,13 @@ func TestRestoreAllGrabOldLock(t *testing.T) { // to a seemingly-old-but-actually-new iptables-restore func TestRestoreAllWaitBackportedIptablesRestore(t *testing.T) { fcmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // iptables version check - func() ([]byte, error) { return []byte("iptables v1.4.22"), nil }, + func() ([]byte, []byte, error) { return []byte("iptables v1.4.22"), nil, nil }, // iptables-restore version check - func() ([]byte, error) { return []byte("iptables v1.4.22"), nil }, - func() ([]byte, error) { return []byte{}, nil }, - func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} }, + func() ([]byte, []byte, error) { return []byte("iptables v1.4.22"), nil, nil }, + func() ([]byte, []byte, error) { return []byte{}, nil, nil }, + func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, } fexec := fakeexec.FakeExec{ diff --git a/pkg/util/netsh/netsh_test.go b/pkg/util/netsh/netsh_test.go index 2194c8318ea..459e2d8899b 100644 --- a/pkg/util/netsh/netsh_test.go +++ b/pkg/util/netsh/netsh_test.go @@ -30,22 +30,22 @@ import ( func fakeCommonRunner() *runner { fakeCmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success - func() ([]byte, error) { - return []byte{}, nil + func() ([]byte, []byte, error) { + return []byte{}, nil, nil }, // utilexec.ExitError exists, and status is not 0 - func() ([]byte, error) { - return nil, &fakeexec.FakeExitError{Status: 1} + func() ([]byte, []byte, error) { + return nil, nil, &fakeexec.FakeExitError{Status: 1} }, // utilexec.ExitError exists, and status is 0 - func() ([]byte, error) { - return nil, &fakeexec.FakeExitError{Status: 0} + func() ([]byte, []byte, error) { + return nil, nil, &fakeexec.FakeExitError{Status: 0} }, // other error exists - func() ([]byte, error) { - return nil, errors.New("not ExitError") + func() ([]byte, []byte, error) { + return nil, nil, errors.New("not ExitError") }, }, } @@ -140,10 +140,10 @@ func TestEnsureIPAddress(t *testing.T) { []fakeexec.FakeCommandAction{ func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // IP address exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10\nIP Address:10.10.10.20"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10\nIP Address:10.10.10.20"), nil, nil }, }, }, cmd, args...) @@ -160,40 +160,40 @@ func TestEnsureIPAddress(t *testing.T) { []fakeexec.FakeCommandAction{ func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // IP address not exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10"), nil, nil }, }, }, cmd, args...) }, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Success to set ip - func() ([]byte, error) { - return []byte(""), nil + func() ([]byte, []byte, error) { + return []byte(""), nil, nil }, }, }, cmd, args...) }, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // IP address still not exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10"), nil, nil }, }, }, cmd, args...) }, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // IP address exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10\nIP Address:10.10.10.20"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10\nIP Address:10.10.10.20"), nil, nil }, }, }, cmd, args...) @@ -209,20 +209,20 @@ func TestEnsureIPAddress(t *testing.T) { []fakeexec.FakeCommandAction{ func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // IP address not exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10"), nil, nil }, }, }, cmd, args...) }, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Failed to set ip, utilexec.ExitError exists, and status is not 0 - func() ([]byte, error) { - return nil, &fakeexec.FakeExitError{Status: 1} + func() ([]byte, []byte, error) { + return nil, nil, &fakeexec.FakeExitError{Status: 1} }, }, }, cmd, args...) @@ -238,20 +238,20 @@ func TestEnsureIPAddress(t *testing.T) { []fakeexec.FakeCommandAction{ func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // IP address not exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10"), nil, nil }, }, }, cmd, args...) }, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Failed to set ip, utilexec.ExitError exists, and status is 0 - func() ([]byte, error) { - return nil, &fakeexec.FakeExitError{Status: 0} + func() ([]byte, []byte, error) { + return nil, nil, &fakeexec.FakeExitError{Status: 0} }, }, }, cmd, args...) @@ -267,20 +267,20 @@ func TestEnsureIPAddress(t *testing.T) { []fakeexec.FakeCommandAction{ func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // IP address not exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10"), nil, nil }, }, }, cmd, args...) }, func(cmd string, args ...string) exec.Cmd { return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Failed to set ip, other error exists - func() ([]byte, error) { - return nil, errors.New("not ExitError") + func() ([]byte, []byte, error) { + return nil, nil, errors.New("not ExitError") }, }, }, cmd, args...) @@ -369,26 +369,26 @@ func TestRestore(t *testing.T) { func TestCheckIPExists(t *testing.T) { fakeCmd := fakeexec.FakeCmd{ - CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ + CombinedOutputScript: []fakeexec.FakeAction{ // Error exists - func() ([]byte, error) { - return nil, &fakeexec.FakeExitError{Status: 1} + func() ([]byte, []byte, error) { + return nil, nil, &fakeexec.FakeExitError{Status: 1} }, // IP address string is empty - func() ([]byte, error) { - return []byte(""), nil + func() ([]byte, []byte, error) { + return []byte(""), nil, nil }, // "IP Address:" field not exists - func() ([]byte, error) { - return []byte("10.10.10.10"), nil + func() ([]byte, []byte, error) { + return []byte("10.10.10.10"), nil, nil }, // IP not exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10"), nil, nil }, // IP exists - func() ([]byte, error) { - return []byte("IP Address:10.10.10.10\nIP Address:10.10.10.20"), nil + func() ([]byte, []byte, error) { + return []byte("IP Address:10.10.10.10\nIP Address:10.10.10.20"), nil, nil }, }, } diff --git a/pkg/volume/flexvolume/common_test.go b/pkg/volume/flexvolume/common_test.go index bafac3d833b..60a339ba6a2 100644 --- a/pkg/volume/flexvolume/common_test.go +++ b/pkg/volume/flexvolume/common_test.go @@ -39,7 +39,7 @@ func testPlugin(h *harness.Harness) (*flexVolumeAttachablePlugin, string) { }, rootDir } -func assertDriverCall(t *harness.Harness, output exectesting.FakeCombinedOutputAction, expectedCommand string, expectedArgs ...string) exectesting.FakeCommandAction { +func assertDriverCall(t *harness.Harness, output exectesting.FakeAction, expectedCommand string, expectedArgs ...string) exectesting.FakeCommandAction { return func(cmd string, args ...string) exec.Cmd { if cmd != "/plugin/test" { t.Errorf("Wrong executable called: got %v, expected %v", cmd, "/plugin/test") @@ -53,7 +53,7 @@ func assertDriverCall(t *harness.Harness, output exectesting.FakeCombinedOutputA } return &exectesting.FakeCmd{ Argv: args, - CombinedOutputScript: []exectesting.FakeCombinedOutputAction{output}, + CombinedOutputScript: []exectesting.FakeAction{output}, } } } @@ -64,21 +64,21 @@ func fakeRunner(fakeCommands ...exectesting.FakeCommandAction) exec.Interface { } } -func fakeResultOutput(result interface{}) exectesting.FakeCombinedOutputAction { - return func() ([]byte, error) { +func fakeResultOutput(result interface{}) exectesting.FakeAction { + return func() ([]byte, []byte, error) { bytes, err := json.Marshal(result) if err != nil { panic("Unable to marshal result: " + err.Error()) } - return bytes, nil + return bytes, nil, nil } } -func successOutput() exectesting.FakeCombinedOutputAction { +func successOutput() exectesting.FakeAction { return fakeResultOutput(&DriverStatus{StatusSuccess, "", "", "", true, nil, 0}) } -func notSupportedOutput() exectesting.FakeCombinedOutputAction { +func notSupportedOutput() exectesting.FakeAction { return fakeResultOutput(&DriverStatus{StatusNotSupported, "", "", "", false, nil, 0}) } diff --git a/pkg/volume/flexvolume/plugin_test.go b/pkg/volume/flexvolume/plugin_test.go index f96dd4a240e..a9c3b888e9e 100644 --- a/pkg/volume/flexvolume/plugin_test.go +++ b/pkg/volume/flexvolume/plugin_test.go @@ -34,7 +34,7 @@ func TestInit(tt *testing.T) { plugin.Init(plugin.host) } -func fakeVolumeNameOutput(name string) testingexec.FakeCombinedOutputAction { +func fakeVolumeNameOutput(name string) testingexec.FakeAction { return fakeResultOutput(&DriverStatus{ Status: StatusSuccess, VolumeName: name, diff --git a/pkg/volume/git_repo/git_repo_test.go b/pkg/volume/git_repo/git_repo_test.go index 989776678e7..1925325ee0f 100644 --- a/pkg/volume/git_repo/git_repo_test.go +++ b/pkg/volume/git_repo/git_repo_test.go @@ -387,19 +387,19 @@ func doTestSetUp(scenario struct { allErrs := []error{} // Construct combined outputs from expected commands - var fakeOutputs []fakeexec.FakeCombinedOutputAction + var fakeOutputs []fakeexec.FakeAction var fcmd fakeexec.FakeCmd for _, expected := range expecteds { if expected.cmd[1] == "clone" { - fakeOutputs = append(fakeOutputs, func() ([]byte, error) { + fakeOutputs = append(fakeOutputs, func() ([]byte, []byte, error) { // git clone, it creates new dir/files os.MkdirAll(filepath.Join(fcmd.Dirs[0], expected.dir), 0750) - return []byte{}, nil + return []byte{}, nil, nil }) } else { // git checkout || git reset, they create nothing - fakeOutputs = append(fakeOutputs, func() ([]byte, error) { - return []byte{}, nil + fakeOutputs = append(fakeOutputs, func() ([]byte, []byte, error) { + return []byte{}, nil, nil }) } } diff --git a/pkg/volume/testing/testing.go b/pkg/volume/testing/testing.go index 0bdad8924ba..1d45b0dcadc 100644 --- a/pkg/volume/testing/testing.go +++ b/pkg/volume/testing/testing.go @@ -335,14 +335,14 @@ func makeFakeCmd(fakeCmd *testingexec.FakeCmd, cmd string, args ...string) testi } } -func makeFakeOutput(output string, rc int) testingexec.FakeCombinedOutputAction { +func makeFakeOutput(output string, rc int) testingexec.FakeAction { o := output var e error if rc != 0 { e = testingexec.FakeExitError{Status: rc} } - return func() ([]byte, error) { - return []byte(o), e + return func() ([]byte, []byte, error) { + return []byte(o), nil, e } } diff --git a/staging/src/k8s.io/apiextensions-apiserver/go.mod b/staging/src/k8s.io/apiextensions-apiserver/go.mod index 4b4353746ea..00839e2b0f1 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/go.mod +++ b/staging/src/k8s.io/apiextensions-apiserver/go.mod @@ -29,7 +29,7 @@ require ( k8s.io/component-base v0.0.0 k8s.io/klog v1.0.0 k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc sigs.k8s.io/yaml v1.1.0 ) diff --git a/staging/src/k8s.io/apiextensions-apiserver/go.sum b/staging/src/k8s.io/apiextensions-apiserver/go.sum index d6771899a36..ecddcbf0981 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/go.sum +++ b/staging/src/k8s.io/apiextensions-apiserver/go.sum @@ -465,8 +465,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/staging/src/k8s.io/apiserver/go.mod b/staging/src/k8s.io/apiserver/go.mod index 1568ae59865..823b5bdaa83 100644 --- a/staging/src/k8s.io/apiserver/go.mod +++ b/staging/src/k8s.io/apiserver/go.mod @@ -51,7 +51,7 @@ require ( k8s.io/component-base v0.0.0 k8s.io/klog v1.0.0 k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 sigs.k8s.io/yaml v1.1.0 ) diff --git a/staging/src/k8s.io/apiserver/go.sum b/staging/src/k8s.io/apiserver/go.sum index 9b2820febc6..a3089093daa 100644 --- a/staging/src/k8s.io/apiserver/go.sum +++ b/staging/src/k8s.io/apiserver/go.sum @@ -362,8 +362,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= diff --git a/staging/src/k8s.io/cli-runtime/go.sum b/staging/src/k8s.io/cli-runtime/go.sum index 31f1c41c555..1a07c563a21 100644 --- a/staging/src/k8s.io/cli-runtime/go.sum +++ b/staging/src/k8s.io/cli-runtime/go.sum @@ -245,8 +245,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= diff --git a/staging/src/k8s.io/client-go/go.mod b/staging/src/k8s.io/client-go/go.mod index ea1d672092a..dc3be3660f2 100644 --- a/staging/src/k8s.io/client-go/go.mod +++ b/staging/src/k8s.io/client-go/go.mod @@ -31,7 +31,7 @@ require ( k8s.io/api v0.0.0 k8s.io/apimachinery v0.0.0 k8s.io/klog v1.0.0 - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc sigs.k8s.io/yaml v1.1.0 ) diff --git a/staging/src/k8s.io/client-go/go.sum b/staging/src/k8s.io/client-go/go.sum index efc6abc58c7..72c14b68641 100644 --- a/staging/src/k8s.io/client-go/go.sum +++ b/staging/src/k8s.io/client-go/go.sum @@ -200,8 +200,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/cloud-provider/go.mod b/staging/src/k8s.io/cloud-provider/go.mod index 74448e6e3e9..e88a5ca6e73 100644 --- a/staging/src/k8s.io/cloud-provider/go.mod +++ b/staging/src/k8s.io/cloud-provider/go.mod @@ -9,7 +9,7 @@ require ( k8s.io/apimachinery v0.0.0 k8s.io/client-go v0.0.0 k8s.io/klog v1.0.0 - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc ) replace ( diff --git a/staging/src/k8s.io/cloud-provider/go.sum b/staging/src/k8s.io/cloud-provider/go.sum index 213289a37a3..f6744911a20 100644 --- a/staging/src/k8s.io/cloud-provider/go.sum +++ b/staging/src/k8s.io/cloud-provider/go.sum @@ -182,8 +182,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/component-base/go.mod b/staging/src/k8s.io/component-base/go.mod index 643b8df7ad4..6be78df4255 100644 --- a/staging/src/k8s.io/component-base/go.mod +++ b/staging/src/k8s.io/component-base/go.mod @@ -16,7 +16,7 @@ require ( k8s.io/apimachinery v0.0.0 k8s.io/client-go v0.0.0 k8s.io/klog v1.0.0 - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc ) replace ( diff --git a/staging/src/k8s.io/component-base/go.sum b/staging/src/k8s.io/component-base/go.sum index 84286ff6e78..56975bf1056 100644 --- a/staging/src/k8s.io/component-base/go.sum +++ b/staging/src/k8s.io/component-base/go.sum @@ -221,8 +221,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/csi-translation-lib/go.sum b/staging/src/k8s.io/csi-translation-lib/go.sum index 360367fa560..cdd90fdb77a 100644 --- a/staging/src/k8s.io/csi-translation-lib/go.sum +++ b/staging/src/k8s.io/csi-translation-lib/go.sum @@ -164,7 +164,7 @@ k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/kube-aggregator/go.mod b/staging/src/k8s.io/kube-aggregator/go.mod index ac6f7254df7..6a54ffe4f4c 100644 --- a/staging/src/k8s.io/kube-aggregator/go.mod +++ b/staging/src/k8s.io/kube-aggregator/go.mod @@ -21,7 +21,7 @@ require ( k8s.io/component-base v0.0.0 k8s.io/klog v1.0.0 k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc ) replace ( diff --git a/staging/src/k8s.io/kube-aggregator/go.sum b/staging/src/k8s.io/kube-aggregator/go.sum index 7f0525b22f5..315236341fa 100644 --- a/staging/src/k8s.io/kube-aggregator/go.sum +++ b/staging/src/k8s.io/kube-aggregator/go.sum @@ -396,8 +396,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/staging/src/k8s.io/kube-controller-manager/go.sum b/staging/src/k8s.io/kube-controller-manager/go.sum index c317b489722..917c5aa93e6 100644 --- a/staging/src/k8s.io/kube-controller-manager/go.sum +++ b/staging/src/k8s.io/kube-controller-manager/go.sum @@ -194,8 +194,8 @@ k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/kube-proxy/go.sum b/staging/src/k8s.io/kube-proxy/go.sum index c317b489722..917c5aa93e6 100644 --- a/staging/src/k8s.io/kube-proxy/go.sum +++ b/staging/src/k8s.io/kube-proxy/go.sum @@ -194,8 +194,8 @@ k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/kube-scheduler/go.sum b/staging/src/k8s.io/kube-scheduler/go.sum index c317b489722..917c5aa93e6 100644 --- a/staging/src/k8s.io/kube-scheduler/go.sum +++ b/staging/src/k8s.io/kube-scheduler/go.sum @@ -194,8 +194,8 @@ k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/staging/src/k8s.io/kubectl/go.mod b/staging/src/k8s.io/kubectl/go.mod index 094e0168508..2ba9dfbe9e7 100644 --- a/staging/src/k8s.io/kubectl/go.mod +++ b/staging/src/k8s.io/kubectl/go.mod @@ -44,7 +44,7 @@ require ( k8s.io/klog v1.0.0 k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a k8s.io/metrics v0.0.0 - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc sigs.k8s.io/kustomize v2.0.3+incompatible sigs.k8s.io/yaml v1.1.0 vbom.ml/util v0.0.0-20160121211510-db5cfe13f5cc diff --git a/staging/src/k8s.io/kubectl/go.sum b/staging/src/k8s.io/kubectl/go.sum index a948274e934..78cdbcda2d6 100644 --- a/staging/src/k8s.io/kubectl/go.sum +++ b/staging/src/k8s.io/kubectl/go.sum @@ -331,8 +331,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/staging/src/k8s.io/legacy-cloud-providers/go.mod b/staging/src/k8s.io/legacy-cloud-providers/go.mod index f14e0dd1180..96001956b82 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/go.mod +++ b/staging/src/k8s.io/legacy-cloud-providers/go.mod @@ -33,7 +33,7 @@ require ( k8s.io/component-base v0.0.0 k8s.io/csi-translation-lib v0.0.0 k8s.io/klog v1.0.0 - k8s.io/utils v0.0.0-20191114184206-e782cd3c129f + k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc sigs.k8s.io/yaml v1.1.0 ) diff --git a/staging/src/k8s.io/legacy-cloud-providers/go.sum b/staging/src/k8s.io/legacy-cloud-providers/go.sum index 99a673892a1..fb3a8acd010 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/go.sum +++ b/staging/src/k8s.io/legacy-cloud-providers/go.sum @@ -355,8 +355,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= diff --git a/staging/src/k8s.io/metrics/go.sum b/staging/src/k8s.io/metrics/go.sum index 7babcfee161..9d35a3e6f9d 100644 --- a/staging/src/k8s.io/metrics/go.sum +++ b/staging/src/k8s.io/metrics/go.sum @@ -225,8 +225,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/staging/src/k8s.io/node-api/go.sum b/staging/src/k8s.io/node-api/go.sum index 32ba9531eba..e2f0f0023a6 100644 --- a/staging/src/k8s.io/node-api/go.sum +++ b/staging/src/k8s.io/node-api/go.sum @@ -229,8 +229,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/staging/src/k8s.io/sample-apiserver/go.sum b/staging/src/k8s.io/sample-apiserver/go.sum index cd6f2a7e5a5..470f96173db 100644 --- a/staging/src/k8s.io/sample-apiserver/go.sum +++ b/staging/src/k8s.io/sample-apiserver/go.sum @@ -393,8 +393,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/staging/src/k8s.io/sample-cli-plugin/go.sum b/staging/src/k8s.io/sample-cli-plugin/go.sum index 31f1c41c555..1a07c563a21 100644 --- a/staging/src/k8s.io/sample-cli-plugin/go.sum +++ b/staging/src/k8s.io/sample-cli-plugin/go.sum @@ -245,8 +245,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= sigs.k8s.io/kustomize v2.0.3+incompatible h1:JUufWFNlI44MdtnjUqVnvh29rR37PQFzPbLXqhyOyX0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= diff --git a/staging/src/k8s.io/sample-controller/go.sum b/staging/src/k8s.io/sample-controller/go.sum index 280ef771de9..8ff82d0762e 100644 --- a/staging/src/k8s.io/sample-controller/go.sum +++ b/staging/src/k8s.io/sample-controller/go.sum @@ -230,8 +230,8 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54= +k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/vendor/k8s.io/utils/exec/testing/fake_exec.go b/vendor/k8s.io/utils/exec/testing/fake_exec.go index e2db6f27acb..2f66a244406 100644 --- a/vendor/k8s.io/utils/exec/testing/fake_exec.go +++ b/vendor/k8s.io/utils/exec/testing/fake_exec.go @@ -87,10 +87,13 @@ func (fake *FakeExec) LookPath(file string) (string, error) { // FakeCmd is a simple scripted Cmd type. type FakeCmd struct { Argv []string - CombinedOutputScript []FakeCombinedOutputAction + CombinedOutputScript []FakeAction CombinedOutputCalls int CombinedOutputLog [][]string - RunScript []FakeRunAction + OutputScript []FakeAction + OutputCalls int + OutputLog [][]string + RunScript []FakeAction RunCalls int RunLog [][]string Dirs []string @@ -120,11 +123,8 @@ type FakeStdIOPipeResponse struct { Error error } -// FakeCombinedOutputAction is a function type -type FakeCombinedOutputAction func() ([]byte, error) - -// FakeRunAction is a function type -type FakeRunAction func() ([]byte, []byte, error) +// FakeAction is a function type +type FakeAction func() ([]byte, []byte, error) // SetDir sets the directory func (fake *FakeCmd) SetDir(dir string) { @@ -213,12 +213,26 @@ func (fake *FakeCmd) CombinedOutput() ([]byte, error) { i := fake.CombinedOutputCalls fake.CombinedOutputLog = append(fake.CombinedOutputLog, append([]string{}, fake.Argv...)) fake.CombinedOutputCalls++ - return fake.CombinedOutputScript[i]() + stdout, _, err := fake.CombinedOutputScript[i]() + return stdout, err } // Output is the response from the command func (fake *FakeCmd) Output() ([]byte, error) { - return nil, fmt.Errorf("unimplemented") + if fake.DisableScripts { + return []byte{}, nil + } + if fake.OutputCalls > len(fake.OutputScript)-1 { + panic("ran out of Output() actions") + } + if fake.OutputLog == nil { + fake.OutputLog = [][]string{} + } + i := fake.OutputCalls + fake.OutputLog = append(fake.OutputLog, append([]string{}, fake.Argv...)) + fake.OutputCalls++ + stdout, _, err := fake.OutputScript[i]() + return stdout, err } // Stop is to stop the process diff --git a/vendor/modules.txt b/vendor/modules.txt index 25d5b44a136..9ca0f7a2bfc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1892,7 +1892,7 @@ k8s.io/sample-apiserver/pkg/registry/wardle/fischer k8s.io/sample-apiserver/pkg/registry/wardle/flunder # k8s.io/system-validators v1.0.4 => k8s.io/system-validators v1.0.4 k8s.io/system-validators/validators -# k8s.io/utils v0.0.0-20191114184206-e782cd3c129f => k8s.io/utils v0.0.0-20191114184206-e782cd3c129f +# k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc => k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc k8s.io/utils/buffer k8s.io/utils/clock k8s.io/utils/exec