fix: only check catalogue once

This commit is contained in:
2021-11-19 15:50:29 +01:00
parent d821975aa2
commit 304b70639f
5 changed files with 25 additions and 10 deletions

View File

@ -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 {