Skip to content

Commit

Permalink
Improve repositores code
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sverdlov <[email protected]>
  • Loading branch information
sverdlov93 committed Oct 28, 2024
1 parent c126283 commit b9913e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions artifactory/utils/container/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b9913e1

Please sign in to comment.