diff --git a/test/integration/functional_test.go b/test/integration/functional_test.go index 825ac14c62..ef9d6edc23 100644 --- a/test/integration/functional_test.go +++ b/test/integration/functional_test.go @@ -272,6 +272,13 @@ func runImageList(ctx context.Context, t *testing.T, profile, testName, format s }) } +func expectedImageFormat(format string) []string { + return []string{ + fmt.Sprintf(format, "k8s.gcr.io/pause"), + fmt.Sprintf(format, "k8s.gcr.io/kube-apiserver"), + } +} + // validateImageCommands runs tests on all the `minikube image` commands, ex. `minikube image load`, `minikube image list`, etc. func validateImageCommands(ctx context.Context, t *testing.T, profile string) { // docs(skip): Skips on `none` driver as image loading is not supported @@ -283,10 +290,10 @@ func validateImageCommands(ctx context.Context, t *testing.T, profile string) { t.Skip("skipping on darwin github action runners, as this test requires a running docker daemon") } - runImageList(ctx, t, profile, "ImageListShort", "short", []string{"k8s.gcr.io/pause", "k8s.gcr.io/kube-apiserver"}) - runImageList(ctx, t, profile, "ImageListTable", "table", []string{"| k8s.gcr.io/pause", "| k8s.gcr.io/kube-apiserver"}) - runImageList(ctx, t, profile, "ImageListJson", "json", []string{"[\"k8s.gcr.io/pause", "[\"k8s.gcr.io/kube-apiserver"}) - runImageList(ctx, t, profile, "ImageListYaml", "yaml", []string{"- k8s.gcr.io/pause", "- k8s.gcr.io/kube-apiserver"}) + runImageList(ctx, t, profile, "ImageListShort", "short", expectedImageFormat("%s")) + runImageList(ctx, t, profile, "ImageListTable", "table", expectedImageFormat("| %s")) + runImageList(ctx, t, profile, "ImageListJson", "json", expectedImageFormat("[\"%s")) + runImageList(ctx, t, profile, "ImageListYaml", "yaml", expectedImageFormat("- %s")) // docs: Make sure image building works by `minikube image build` t.Run("ImageBuild", func(t *testing.T) {