forked from coop-cloud/abra
fix: only check catalogue once
This commit is contained in:
parent
d821975aa2
commit
304b70639f
@ -101,6 +101,11 @@ can take some time.
|
||||
canUpgradeCount int
|
||||
)
|
||||
|
||||
catl, err := catalogue.ReadRecipeCatalogue()
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
for _, app := range apps {
|
||||
var tableRow []string
|
||||
if app.Type == appType || appType == "" {
|
||||
@ -126,7 +131,8 @@ can take some time.
|
||||
|
||||
var newUpdates []string
|
||||
if version != "unknown" {
|
||||
updates, err := catalogue.GetRecipeCatalogueVersions(app.Type)
|
||||
|
||||
updates, err := catalogue.GetRecipeCatalogueVersions(app.Type, catl)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
@ -70,7 +70,12 @@ recipes.
|
||||
logrus.Fatalf("'%s' is not deployed?", app.Name)
|
||||
}
|
||||
|
||||
versions, err := catalogue.GetRecipeCatalogueVersions(app.Type)
|
||||
catl, err := catalogue.ReadRecipeCatalogue()
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
versions, err := catalogue.GetRecipeCatalogueVersions(app.Type, catl)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
@ -62,7 +62,12 @@ recipes.
|
||||
logrus.Fatalf("'%s' is not deployed?", app.Name)
|
||||
}
|
||||
|
||||
versions, err := catalogue.GetRecipeCatalogueVersions(app.Type)
|
||||
catl, err := catalogue.ReadRecipeCatalogue()
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
versions, err := catalogue.GetRecipeCatalogueVersions(app.Type, catl)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
@ -45,7 +45,11 @@ func DeployAction(c *cli.Context) error {
|
||||
|
||||
version := deployedVersion
|
||||
if version == "" && !Chaos {
|
||||
versions, err := catalogue.GetRecipeCatalogueVersions(app.Type)
|
||||
catl, err := catalogue.ReadRecipeCatalogue()
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
versions, err := catalogue.GetRecipeCatalogueVersions(app.Type, catl)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
@ -480,14 +480,9 @@ func GetRecipeVersions(recipeName string) (RecipeVersions, error) {
|
||||
}
|
||||
|
||||
// GetRecipeCatalogueVersions list the recipe versions listed in the recipe catalogue.
|
||||
func GetRecipeCatalogueVersions(recipeName string) ([]string, error) {
|
||||
func GetRecipeCatalogueVersions(recipeName string, catl RecipeCatalogue) ([]string, error) {
|
||||
var versions []string
|
||||
|
||||
catl, err := ReadRecipeCatalogue()
|
||||
if err != nil {
|
||||
return versions, err
|
||||
}
|
||||
|
||||
if recipeMeta, exists := catl[recipeName]; exists {
|
||||
for _, versionMeta := range recipeMeta.Versions {
|
||||
for tag := range versionMeta {
|
||||
|
Loading…
Reference in New Issue
Block a user