refactor(recipe): remove remaining usage of old recipe struct

This commit is contained in:
2024-07-08 13:15:20 +02:00
parent c1b03bcbd7
commit 5617a9ba07
24 changed files with 167 additions and 189 deletions

View File

@ -73,8 +73,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
Action: func(c *cli.Context) error {
recipe := internal.ValidateRecipe(c)
r := recipePkg.Get2(recipe.Name)
if err := r.Ensure(internal.Chaos, internal.Offline); err != nil {
if err := recipe.Ensure(internal.Chaos, internal.Offline); err != nil {
log.Fatal(err)
}
@ -97,7 +96,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
versionsPresent := false
recipeDir := path.Join(config.RECIPES_DIR, recipe.Name)
versionsPath := path.Join(recipeDir, "versions")
var servicePins = make(map[string]imgPin)
servicePins := make(map[string]imgPin)
if _, err := os.Stat(versionsPath); err == nil {
log.Debugf("found versions file for %s", recipe.Name)
file, err := os.Open(versionsPath)
@ -130,7 +129,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
log.Debugf("did not find versions file for %s", recipe.Name)
}
config, err := r.GetComposeConfig(nil)
config, err := recipe.GetComposeConfig(nil)
if err != nil {
log.Fatal(err)
}
@ -299,7 +298,7 @@ You may invoke this command in "wizard" mode and be prompted for input:
}
}
if upgradeTag != "skip" {
ok, err := r.UpdateTag(image, upgradeTag)
ok, err := recipe.UpdateTag(image, upgradeTag)
if err != nil {
log.Fatal(err)
}