From b9913e136f4cf28df49a66ec358e0cde385ef658 Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Mon, 28 Oct 2024 16:26:21 +0200 Subject: [PATCH] Improve repositores code Signed-off-by: Michael Sverdlov --- artifactory/utils/container/image.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/artifactory/utils/container/image.go b/artifactory/utils/container/image.go index 2dc462007..bf1b1d369 100644 --- a/artifactory/utils/container/image.go +++ b/artifactory/utils/container/image.go @@ -90,15 +90,15 @@ func (image *Image) GetImageShortNameWithTag() (string, error) { // e.g., "docker-local/myorg/hello-world:latest" -> "myorg/hello-world:latest" // e.g., "docker-local/hello-world:latest" -> "hello-world:latest" func (image *Image) GetImageLongNameWithoutRepoWithTag() (string, error) { - imageName, err := image.GetImageLongNameWithTag() + longName, err := image.GetImageLongNameWithTag() if err != nil { return "", err } - parts := strings.Split(imageName, "/") + parts := strings.Split(longName, "/") if len(parts) > 1 { return strings.Join(parts[1:], "/"), nil } - return parts[0], nil + return longName, nil } // Get image tag name of an image.