From 9526aba20006f6bb28bd515d17540523eb2227d7 Mon Sep 17 00:00:00 2001 From: Nima Kaviani Date: Tue, 17 Oct 2023 21:27:24 -0700 Subject: [PATCH] use the right reference when deleting the image fixes #36 --- pkg/controllers/gitserver/image_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/controllers/gitserver/image_test.go b/pkg/controllers/gitserver/image_test.go index 62c55916..9efcbd21 100644 --- a/pkg/controllers/gitserver/image_test.go +++ b/pkg/controllers/gitserver/image_test.go @@ -2,6 +2,7 @@ package gitserver import ( "context" + "fmt" "strings" "testing" @@ -52,7 +53,8 @@ func TestReconcileGitServerImage(t *testing.T) { t.Errorf("Getting docker client: %v", err) } - _, err = dockerClient.ImageRemove(ctx, resource.Status.ImageID, types.ImageRemoveOptions{}) + imageNameID := fmt.Sprintf("%s@%s", GetImageTag(&resource), resource.Status.ImageID) + _, err = dockerClient.ImageRemove(ctx, imageNameID, types.ImageRemoveOptions{}) if err != nil { t.Errorf("Removing docker image: %v", err) }