Merge pull request #86346 from SataQiu/bump-utils-20191217

Bump k8s.io/utils version
This commit is contained in:
Kubernetes Prow Robot 2019-12-21 23:55:32 -08:00 committed by GitHub
commit 2d310b1321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
51 changed files with 400 additions and 384 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

4
go.mod
View File

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

4
go.sum
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

2
vendor/modules.txt vendored
View File

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