From 55d43bec2827c14df9bafb1b92d114271ae56ebe Mon Sep 17 00:00:00 2001 From: decentral1se Date: Tue, 25 Jul 2023 16:52:30 +0200 Subject: [PATCH] revert: always clone latest recipe changes This change was about trying to optimise for offline scenarios but caused a lot of issues for the online case. It needs to be thought through again. See https://git.coopcloud.tech/coop-cloud/organising/issues/471. Closes https://git.coopcloud.tech/coop-cloud/organising/issues/432. --- cli/internal/new.go | 4 ++-- cli/recipe/release.go | 3 +-- cli/recipe/sync.go | 3 +-- cli/recipe/version.go | 3 +-- cli/updater/updater.go | 2 +- pkg/runtime/runtime.go | 1 + 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cli/internal/new.go b/cli/internal/new.go index 5ad8ca88..86547d4c 100644 --- a/cli/internal/new.go +++ b/cli/internal/new.go @@ -120,9 +120,9 @@ func ensureServerFlag() error { // NewAction is the new app creation logic func NewAction(c *cli.Context) error { - recipe := ValidateRecipeWithPrompt(c, runtime.WithEnsureRecipeLatest(false)) + recipe := ValidateRecipeWithPrompt(c) + conf := runtime.New() - conf := runtime.New(runtime.WithEnsureRecipeLatest(false)) if err := recipePkg.EnsureUpToDate(recipe.Name, conf); err != nil { logrus.Fatal(err) } diff --git a/cli/recipe/release.go b/cli/recipe/release.go index e0c4b696..78a6b291 100644 --- a/cli/recipe/release.go +++ b/cli/recipe/release.go @@ -13,7 +13,6 @@ import ( gitPkg "coopcloud.tech/abra/pkg/git" "coopcloud.tech/abra/pkg/recipe" recipePkg "coopcloud.tech/abra/pkg/recipe" - "coopcloud.tech/abra/pkg/runtime" "coopcloud.tech/tagcmp" "github.com/AlecAivazis/survey/v2" "github.com/docker/distribution/reference" @@ -59,7 +58,7 @@ your SSH keys configured on your account. Before: internal.SubCommandBefore, BashComplete: autocomplete.RecipeNameComplete, Action: func(c *cli.Context) error { - recipe := internal.ValidateRecipeWithPrompt(c, runtime.WithEnsureRecipeLatest(false)) + recipe := internal.ValidateRecipeWithPrompt(c) imagesTmp, err := getImageVersions(recipe) if err != nil { diff --git a/cli/recipe/sync.go b/cli/recipe/sync.go index c6eef20d..f95ba90b 100644 --- a/cli/recipe/sync.go +++ b/cli/recipe/sync.go @@ -8,7 +8,6 @@ import ( "coopcloud.tech/abra/cli/internal" "coopcloud.tech/abra/pkg/autocomplete" "coopcloud.tech/abra/pkg/config" - "coopcloud.tech/abra/pkg/runtime" "coopcloud.tech/tagcmp" "github.com/AlecAivazis/survey/v2" "github.com/go-git/go-git/v5" @@ -42,7 +41,7 @@ auto-generate it for you. The configuration will be updated on the local file system. `, Action: func(c *cli.Context) error { - recipe := internal.ValidateRecipeWithPrompt(c, runtime.WithEnsureRecipeLatest(false)) + recipe := internal.ValidateRecipeWithPrompt(c) mainApp, err := internal.GetMainAppImage(recipe) if err != nil { diff --git a/cli/recipe/version.go b/cli/recipe/version.go index 0434d767..57c4ce9d 100644 --- a/cli/recipe/version.go +++ b/cli/recipe/version.go @@ -5,7 +5,6 @@ import ( "coopcloud.tech/abra/pkg/autocomplete" "coopcloud.tech/abra/pkg/formatter" recipePkg "coopcloud.tech/abra/pkg/recipe" - "coopcloud.tech/abra/pkg/runtime" "github.com/sirupsen/logrus" "github.com/urfave/cli" ) @@ -21,7 +20,7 @@ var recipeVersionCommand = cli.Command{ Before: internal.SubCommandBefore, BashComplete: autocomplete.RecipeNameComplete, Action: func(c *cli.Context) error { - recipe := internal.ValidateRecipe(c, runtime.WithEnsureRecipeLatest(false)) + recipe := internal.ValidateRecipe(c) catalogue, err := recipePkg.ReadRecipeCatalogue() if err != nil { diff --git a/cli/updater/updater.go b/cli/updater/updater.go index 5c2b8f61..789e0f81 100644 --- a/cli/updater/updater.go +++ b/cli/updater/updater.go @@ -114,7 +114,7 @@ update chaos deployments use the "--chaos" flag. Use it with care. logrus.Fatal(err) } - conf := runtime.New(runtime.WithEnsureRecipeLatest(true)) + conf := runtime.New() if !updateAll { stackName := c.Args().Get(0) diff --git a/pkg/runtime/runtime.go b/pkg/runtime/runtime.go index f918f22d..2ee968f1 100644 --- a/pkg/runtime/runtime.go +++ b/pkg/runtime/runtime.go @@ -21,6 +21,7 @@ type Option func(c *Config) func New(opts ...Option) *Config { conf := &Config{ EnsureRecipeExists: true, + EnsureRecipeLatest: true, } for _, optFunc := range opts {