refactor: centralise tag meta stripping

This commit is contained in:
2022-01-05 17:32:33 +01:00
parent 49ccf2d204
commit 74dfb12fd6
4 changed files with 30 additions and 15 deletions

View File

@ -2,9 +2,9 @@ package internal
import (
"fmt"
"strings"
"coopcloud.tech/abra/pkg/recipe"
recipePkg "coopcloud.tech/abra/pkg/recipe"
"github.com/AlecAivazis/survey/v2"
"github.com/docker/distribution/reference"
"github.com/sirupsen/logrus"
@ -94,9 +94,7 @@ func GetMainAppImage(recipe recipe.Recipe) (string, error) {
}
path = reference.Path(img)
if strings.Contains(path, "library") {
path = strings.Split(path, "/")[1]
}
path = recipePkg.StripTagMeta(path)
return path, nil
}