forked from toolshed/abra
refactor: put StripTagMeta into formatter package
Avoid circular import.
This commit is contained in:
@ -23,7 +23,7 @@ func getImagePath(image string) (string, error) {
|
||||
|
||||
path := reference.Path(img)
|
||||
|
||||
path = recipe.StripTagMeta(path)
|
||||
path = formatter.StripTagMeta(path)
|
||||
|
||||
logrus.Debugf("parsed %s from %s", path, image)
|
||||
|
||||
|
@ -3,8 +3,8 @@ package internal
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"coopcloud.tech/abra/pkg/formatter"
|
||||
"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,7 +94,7 @@ func GetMainAppImage(recipe recipe.Recipe) (string, error) {
|
||||
}
|
||||
|
||||
path = reference.Path(img)
|
||||
path = recipePkg.StripTagMeta(path)
|
||||
path = formatter.StripTagMeta(path)
|
||||
|
||||
return path, nil
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ func getImageVersions(recipe recipe.Recipe) (map[string]string, error) {
|
||||
|
||||
path := reference.Path(img)
|
||||
|
||||
path = recipePkg.StripTagMeta(path)
|
||||
path = formatter.StripTagMeta(path)
|
||||
|
||||
var tag string
|
||||
switch img.(type) {
|
||||
|
@ -12,6 +12,7 @@ import (
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
"coopcloud.tech/abra/pkg/client"
|
||||
"coopcloud.tech/abra/pkg/config"
|
||||
"coopcloud.tech/abra/pkg/formatter"
|
||||
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
||||
"coopcloud.tech/tagcmp"
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
@ -119,7 +120,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
|
||||
}
|
||||
logrus.Debugf("retrieved %s from remote registry for %s", regVersions, image)
|
||||
|
||||
image = recipePkg.StripTagMeta(image)
|
||||
image = formatter.StripTagMeta(image)
|
||||
|
||||
switch img.(type) {
|
||||
case reference.NamedTagged:
|
||||
|
Reference in New Issue
Block a user