Skip to content

Commit 2d310b1

Browse files
authored
Merge pull request kubernetes#86346 from SataQiu/bump-utils-20191217
Bump k8s.io/utils version
2 parents 42c81a2 + 2497a12 commit 2d310b1

File tree

51 files changed

+400
-384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+400
-384
lines changed

cmd/kubeadm/app/cmd/config_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ func TestConfigImagesListRunWithoutPath(t *testing.T) {
197197

198198
func TestImagesPull(t *testing.T) {
199199
fcmd := fakeexec.FakeCmd{
200-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
201-
func() ([]byte, error) { return nil, nil },
202-
func() ([]byte, error) { return nil, nil },
203-
func() ([]byte, error) { return nil, nil },
204-
func() ([]byte, error) { return nil, nil },
205-
func() ([]byte, error) { return nil, nil },
200+
CombinedOutputScript: []fakeexec.FakeAction{
201+
func() ([]byte, []byte, error) { return nil, nil, nil },
202+
func() ([]byte, []byte, error) { return nil, nil, nil },
203+
func() ([]byte, []byte, error) { return nil, nil, nil },
204+
func() ([]byte, []byte, error) { return nil, nil, nil },
205+
func() ([]byte, []byte, error) { return nil, nil, nil },
206206
},
207207
}
208208

cmd/kubeadm/app/cmd/phases/reset/cleanupnode_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ func TestConfigDirCleaner(t *testing.T) {
197197

198198
func TestRemoveContainers(t *testing.T) {
199199
fcmd := fakeexec.FakeCmd{
200-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
201-
func() ([]byte, error) { return []byte("id1\nid2"), nil },
202-
func() ([]byte, error) { return []byte(""), nil },
203-
func() ([]byte, error) { return []byte(""), nil },
204-
func() ([]byte, error) { return []byte(""), nil },
205-
func() ([]byte, error) { return []byte(""), nil },
200+
CombinedOutputScript: []fakeexec.FakeAction{
201+
func() ([]byte, []byte, error) { return []byte("id1\nid2"), nil, nil },
202+
func() ([]byte, []byte, error) { return []byte(""), nil, nil },
203+
func() ([]byte, []byte, error) { return []byte(""), nil, nil },
204+
func() ([]byte, []byte, error) { return []byte(""), nil, nil },
205+
func() ([]byte, []byte, error) { return []byte(""), nil, nil },
206206
},
207207
}
208208
fexec := fakeexec.FakeExec{

cmd/kubeadm/app/preflight/checks_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ func TestKubeletVersionCheck(t *testing.T) {
694694
for _, tc := range cases {
695695
t.Run(tc.kubeletVersion, func(t *testing.T) {
696696
fcmd := fakeexec.FakeCmd{
697-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
698-
func() ([]byte, error) { return []byte("Kubernetes " + tc.kubeletVersion), nil },
697+
CombinedOutputScript: []fakeexec.FakeAction{
698+
func() ([]byte, []byte, error) { return []byte("Kubernetes " + tc.kubeletVersion), nil, nil },
699699
},
700700
}
701701
fexec := &fakeexec.FakeExec{
@@ -752,7 +752,7 @@ func TestSetHasItemOrAll(t *testing.T) {
752752

753753
func TestImagePullCheck(t *testing.T) {
754754
fcmd := fakeexec.FakeCmd{
755-
RunScript: []fakeexec.FakeRunAction{
755+
RunScript: []fakeexec.FakeAction{
756756
// Test case 1: img1 and img2 exist, img3 doesn't exist
757757
func() ([]byte, []byte, error) { return nil, nil, nil },
758758
func() ([]byte, []byte, error) { return nil, nil, nil },
@@ -763,13 +763,13 @@ func TestImagePullCheck(t *testing.T) {
763763
func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} },
764764
func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} },
765765
},
766-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
766+
CombinedOutputScript: []fakeexec.FakeAction{
767767
// Test case1: pull only img3
768-
func() ([]byte, error) { return nil, nil },
768+
func() ([]byte, []byte, error) { return nil, nil, nil },
769769
// Test case 2: fail to pull image2 and image3
770-
func() ([]byte, error) { return nil, nil },
771-
func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} },
772-
func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} },
770+
func() ([]byte, []byte, error) { return nil, nil, nil },
771+
func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} },
772+
func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} },
773773
},
774774
}
775775

cmd/kubeadm/app/preflight/utils_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ func TestGetKubeletVersion(t *testing.T) {
4747
for _, tc := range cases {
4848
t.Run(tc.output, func(t *testing.T) {
4949
fcmd := fakeexec.FakeCmd{
50-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
51-
func() ([]byte, error) { return []byte(tc.output), tc.err },
50+
CombinedOutputScript: []fakeexec.FakeAction{
51+
func() ([]byte, []byte, error) { return []byte(tc.output), nil, tc.err },
5252
},
5353
}
5454
fexec := &fakeexec.FakeExec{

cmd/kubeadm/app/util/runtime/runtime_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ func genFakeActions(fcmd *fakeexec.FakeCmd, num int) []fakeexec.FakeCommandActio
8383

8484
func TestIsRunning(t *testing.T) {
8585
fcmd := fakeexec.FakeCmd{
86-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
87-
func() ([]byte, error) { return nil, nil },
88-
func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} },
89-
func() ([]byte, error) { return nil, nil },
90-
func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} },
86+
CombinedOutputScript: []fakeexec.FakeAction{
87+
func() ([]byte, []byte, error) { return nil, nil, nil },
88+
func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} },
89+
func() ([]byte, []byte, error) { return nil, nil, nil },
90+
func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} },
9191
},
9292
}
9393

@@ -132,10 +132,10 @@ func TestIsRunning(t *testing.T) {
132132

133133
func TestListKubeContainers(t *testing.T) {
134134
fcmd := fakeexec.FakeCmd{
135-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
136-
func() ([]byte, error) { return []byte("k8s_p1\nk8s_p2"), nil },
137-
func() ([]byte, error) { return nil, &fakeexec.FakeExitError{Status: 1} },
138-
func() ([]byte, error) { return []byte("k8s_p1\nk8s_p2"), nil },
135+
CombinedOutputScript: []fakeexec.FakeAction{
136+
func() ([]byte, []byte, error) { return []byte("k8s_p1\nk8s_p2"), nil, nil },
137+
func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} },
138+
func() ([]byte, []byte, error) { return []byte("k8s_p1\nk8s_p2"), nil, nil },
139139
},
140140
}
141141
execer := fakeexec.FakeExec{
@@ -178,10 +178,10 @@ func TestListKubeContainers(t *testing.T) {
178178
}
179179

180180
func TestRemoveContainers(t *testing.T) {
181-
fakeOK := func() ([]byte, error) { return nil, nil }
182-
fakeErr := func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} }
181+
fakeOK := func() ([]byte, []byte, error) { return nil, nil, nil }
182+
fakeErr := func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} }
183183
fcmd := fakeexec.FakeCmd{
184-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
184+
CombinedOutputScript: []fakeexec.FakeAction{
185185
fakeOK, fakeOK, fakeOK, fakeOK, fakeOK, fakeOK, // Test case 1
186186
fakeOK, fakeOK, fakeOK, fakeErr, fakeOK, fakeOK,
187187
fakeErr, fakeOK, fakeOK, fakeErr, fakeOK,
@@ -227,11 +227,11 @@ func TestRemoveContainers(t *testing.T) {
227227

228228
func TestPullImage(t *testing.T) {
229229
fcmd := fakeexec.FakeCmd{
230-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
231-
func() ([]byte, error) { return nil, nil },
232-
func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} },
233-
func() ([]byte, error) { return nil, nil },
234-
func() ([]byte, error) { return []byte("error"), &fakeexec.FakeExitError{Status: 1} },
230+
CombinedOutputScript: []fakeexec.FakeAction{
231+
func() ([]byte, []byte, error) { return nil, nil, nil },
232+
func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} },
233+
func() ([]byte, []byte, error) { return nil, nil, nil },
234+
func() ([]byte, []byte, error) { return []byte("error"), nil, &fakeexec.FakeExitError{Status: 1} },
235235
},
236236
}
237237
execer := fakeexec.FakeExec{
@@ -271,7 +271,7 @@ func TestPullImage(t *testing.T) {
271271

272272
func TestImageExists(t *testing.T) {
273273
fcmd := fakeexec.FakeCmd{
274-
RunScript: []fakeexec.FakeRunAction{
274+
RunScript: []fakeexec.FakeAction{
275275
func() ([]byte, []byte, error) { return nil, nil, nil },
276276
func() ([]byte, []byte, error) { return nil, nil, &fakeexec.FakeExitError{Status: 1} },
277277
func() ([]byte, []byte, error) { return nil, nil, nil },

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ require (
162162
k8s.io/repo-infra v0.0.1-alpha.1
163163
k8s.io/sample-apiserver v0.0.0
164164
k8s.io/system-validators v1.0.4
165-
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
165+
k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc
166166
sigs.k8s.io/kustomize v2.0.3+incompatible
167167
sigs.k8s.io/yaml v1.1.0
168168
)
@@ -553,7 +553,7 @@ replace (
553553
k8s.io/sample-cli-plugin => ./staging/src/k8s.io/sample-cli-plugin
554554
k8s.io/sample-controller => ./staging/src/k8s.io/sample-controller
555555
k8s.io/system-validators => k8s.io/system-validators v1.0.4
556-
k8s.io/utils => k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
556+
k8s.io/utils => k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc
557557
modernc.org/cc => modernc.org/cc v1.0.0
558558
modernc.org/golex => modernc.org/golex v1.0.0
559559
modernc.org/mathutil => modernc.org/mathutil v1.0.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ k8s.io/repo-infra v0.0.1-alpha.1 h1:2us1n30u3cOcoPsacNfCvCssS9B9Yldr1ZGOdK0728U=
594594
k8s.io/repo-infra v0.0.1-alpha.1/go.mod h1:wO1t9WaB99V80ljbeENTnayuEEwNZt7gECYh/CEyOJ8=
595595
k8s.io/system-validators v1.0.4 h1:sW57tJ/ciqOVbbTLN+ZNy64MJMNqUuiwrirQv8IR2Kw=
596596
k8s.io/system-validators v1.0.4/go.mod h1:HgSgTg4NAGNoYYjKsUyk52gdNi2PVDswQ9Iyn66R7NI=
597-
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo=
598-
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
597+
k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc h1:MUttqhwRgupMiA5ps5F3d2/NLkU8EZSECTGxrQxqM54=
598+
k8s.io/utils v0.0.0-20191217005138-9e5e9d854fcc/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
599599
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
600600
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
601601
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=

pkg/kubelet/dockershim/network/cni/cni_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ func TestCNIPlugin(t *testing.T) {
176176
fakeCmds := []fakeexec.FakeCommandAction{
177177
func(cmd string, args ...string) exec.Cmd {
178178
return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{
179-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
180-
func() ([]byte, error) {
181-
return []byte(podIPOutput), nil
179+
CombinedOutputScript: []fakeexec.FakeAction{
180+
func() ([]byte, []byte, error) {
181+
return []byte(podIPOutput), nil, nil
182182
},
183183
},
184184
}, cmd, args...)

pkg/kubelet/dockershim/network/hairpin/hairpin_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ func TestFindPairInterfaceOfContainerInterface(t *testing.T) {
5656
}
5757
for _, test := range tests {
5858
fcmd := fakeexec.FakeCmd{
59-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
60-
func() ([]byte, error) { return []byte(test.output), test.err },
59+
CombinedOutputScript: []fakeexec.FakeAction{
60+
func() ([]byte, []byte, error) { return []byte(test.output), nil, test.err },
6161
},
6262
}
6363
fexec := fakeexec.FakeExec{

pkg/kubelet/dockershim/network/kubenet/kubenet_linux_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ func TestGetPodNetworkStatus(t *testing.T) {
100100
for _, t := range testCases {
101101
// the fake commands return the IP from the given index, or an error
102102
fCmd := fakeexec.FakeCmd{
103-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
104-
func() ([]byte, error) {
103+
CombinedOutputScript: []fakeexec.FakeAction{
104+
func() ([]byte, []byte, error) {
105105
ips, ok := podIPMap[kubecontainer.ContainerID{ID: t.id}]
106106
if !ok {
107-
return nil, fmt.Errorf("Pod IP %q not found", t.id)
107+
return nil, nil, fmt.Errorf("Pod IP %q not found", t.id)
108108
}
109109
ipsList := ips.UnsortedList()
110-
return []byte(ipsList[0]), nil
110+
return []byte(ipsList[0]), nil, nil
111111
},
112112
},
113113
}
@@ -202,9 +202,9 @@ func TestInit_MTU(t *testing.T) {
202202
{
203203
// modprobe br-netfilter
204204
fCmd := fakeexec.FakeCmd{
205-
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{
206-
func() ([]byte, error) {
207-
return make([]byte, 0), nil
205+
CombinedOutputScript: []fakeexec.FakeAction{
206+
func() ([]byte, []byte, error) {
207+
return make([]byte, 0), nil, nil
208208
},
209209
},
210210
}

0 commit comments

Comments
 (0)