From e6948b90b4aa9a7047cb4be2303d7425c8938c8c Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Sat, 21 Mar 2020 10:47:08 -0700 Subject: [PATCH] Trim crio prefix, dedup results --- test/integration/start_stop_delete_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index c891309a69..38ca1d9b9a 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -260,12 +260,14 @@ func testPulledImages(ctx context.Context, t *testing.T, profile string, version if err != nil { t.Errorf("images unmarshal: %v", err) } - gotImages := []string{} + found := map[string]bool{} for _, img := range jv["images"] { for _, i := range img.Tags { + // Remove container-specific prefixes for naming consistency + i = strings.TrimPrefix(i, "docker.io/") + i = strings.TrimPrefix(i, "localhost/") if defaultImage(i) { - // Remove docker.io for naming consistency between container runtimes - gotImages = append(gotImages, strings.TrimPrefix(i, "docker.io/")) + found[i] = true } else { t.Logf("Found non-minikube image: %s", i) } @@ -275,6 +277,10 @@ func testPulledImages(ctx context.Context, t *testing.T, profile string, version if err != nil { t.Errorf("kubeadm images: %v", version) } + gotImages := []string{} + for k := range found { + gotImages = append(gotImages, k) + } sort.Strings(want) sort.Strings(gotImages) if diff := cmp.Diff(want, gotImages); diff != "" {