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