Skip to content

Commit a244828

Browse files
authored
Merge pull request #9781 from prezha/fix-TestStartStop-crio-VerifyKubernetesImages
fix TestStartStop crio VerifyKubernetesImages serial test
2 parents 7dad70d + a60176c commit a244828

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

pkg/minikube/bootstrapper/images/images.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ import (
2929
// Pause returns the image name to pull for a given Kubernetes version
3030
func Pause(v semver.Version, mirror string) string {
3131
// Should match `PauseVersion` in:
32-
// https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/constants/constants.go
32+
// https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/constants/constants_unix.go
3333
pv := "3.2"
3434
if semver.MustParseRange("<1.18.0-alpha.0")(v) {
3535
pv = "3.1"
3636
}
3737
return path.Join(kubernetesRepo(mirror), "pause"+archTag(false)+pv)
3838
}
3939

40-
// essentials returns images needed too bootstrap a kubenretes
40+
// essentials returns images needed too bootstrap a Kubernetes
4141
func essentials(mirror string, v semver.Version) []string {
4242
imgs := []string{
4343
componentImage("kube-proxy", v, mirror),

test/integration/start_stop_delete_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func TestStartStop(t *testing.T) {
110110
{"UserAppExistsAfterStop", validateAppExistsAfterStop},
111111
{"AddonExistsAfterStop", validateAddonAfterStop},
112112
{"VerifyKubernetesImages", validateKubernetesImages},
113-
{"Pause", validatePauseAfterSart},
113+
{"Pause", validatePauseAfterStart},
114114
}
115115
for _, stc := range serialTests {
116116
if ctx.Err() == context.DeadlineExceeded {
@@ -233,7 +233,7 @@ func validateKubernetesImages(ctx context.Context, t *testing.T, profile string,
233233
}
234234
}
235235

236-
func validatePauseAfterSart(ctx context.Context, t *testing.T, profile string, tcName string, tcVersion string, startArgs []string) {
236+
func validatePauseAfterStart(ctx context.Context, t *testing.T, profile string, tcName string, tcVersion string, startArgs []string) {
237237
defer PostMortemLogs(t, profile)
238238
testPause(ctx, t, profile)
239239
}
@@ -317,8 +317,16 @@ func testPulledImages(ctx context.Context, t *testing.T, profile string, version
317317
}
318318
sort.Strings(want)
319319
sort.Strings(gotImages)
320-
if diff := cmp.Diff(want, gotImages); diff != "" {
321-
t.Errorf("%s images mismatch (-want +got):\n%s", version, diff)
320+
// check if we got all the images we want, ignoring any extraneous ones in cache (eg, may be created by other tests)
321+
missing := false
322+
for _, img := range want {
323+
if sort.SearchStrings(gotImages, img) == len(gotImages) {
324+
missing = true
325+
break
326+
}
327+
}
328+
if missing {
329+
t.Errorf("%s images missing (-want +got):\n%s", version, cmp.Diff(want, gotImages))
322330
}
323331
}
324332

0 commit comments

Comments
 (0)