feat: support version/upgrade listing
Closes coop-cloud/organising#130.
This commit is contained in:
@ -480,3 +480,23 @@ func GetRecipeVersions(recipeName string) (RecipeVersions, error) {
|
||||
|
||||
return versions, nil
|
||||
}
|
||||
|
||||
// GetRecipeCatalogueVersions list the recipe versions listed in the recipe catalogue.
|
||||
func GetRecipeCatalogueVersions(recipeName string) ([]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 {
|
||||
versions = append(versions, tag)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return versions, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user