From 3d10d69c9b5935e8f79c9a23e36fd2408ca588ce Mon Sep 17 00:00:00 2001 From: Diogo Recharte Date: Sat, 18 Jan 2025 10:01:42 +0000 Subject: [PATCH 1/2] EVEREST-107 update helm chart (#1020) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8136f7f83..0e3078677 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( github.com/operator-framework/api v0.27.0 github.com/operator-framework/operator-lifecycle-manager v0.27.0 github.com/percona/everest-operator v0.6.0-dev1.0.20250113063626-b38e7d1b3932 - github.com/percona/percona-helm-charts/charts/everest v0.0.0-20250115071212-bc3ad1c4c054 + github.com/percona/percona-helm-charts/charts/everest v0.0.0-20250117110506-e038d85918c5 github.com/rodaine/table v1.3.0 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.18.2 diff --git a/go.sum b/go.sum index a19610a04..29a5c95f2 100644 --- a/go.sum +++ b/go.sum @@ -2228,8 +2228,8 @@ github.com/percona/everest-operator v0.6.0-dev1.0.20250113063626-b38e7d1b3932 h1 github.com/percona/everest-operator v0.6.0-dev1.0.20250113063626-b38e7d1b3932/go.mod h1:76ol+aF1CAkDey7kNkqmgtcjdTzJdEMFegfUiGS3q7M= github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939 h1:OggdqSzqe9pO3A4GaRlrLwZXS3zEQ84O4+7Jm9cg74s= github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939/go.mod h1:KhIlTT4wR2mIkMvDtEFerr9zaADJorL7UThSztzxBaY= -github.com/percona/percona-helm-charts/charts/everest v0.0.0-20250115071212-bc3ad1c4c054 h1:8zdmCMqxg6hhGj/Y9SVzf1z+x0NemuT0KsRe51OSKbs= -github.com/percona/percona-helm-charts/charts/everest v0.0.0-20250115071212-bc3ad1c4c054/go.mod h1:j5Ci48Azwb4Xs4XvZQNfleWCn2uyiZywazklxNH1ut4= +github.com/percona/percona-helm-charts/charts/everest v0.0.0-20250117110506-e038d85918c5 h1:+cv7z5tYacTjX7qaya5HYfIp3FB16zmChFKmJTVFLOY= +github.com/percona/percona-helm-charts/charts/everest v0.0.0-20250117110506-e038d85918c5/go.mod h1:j5Ci48Azwb4Xs4XvZQNfleWCn2uyiZywazklxNH1ut4= github.com/percona/percona-postgresql-operator v0.0.0-20241007204305-35d61aa5aebd h1:9RCUfPUxbdXuL/247r77DJmRSowDzA2xzZC9FpuLuUw= github.com/percona/percona-postgresql-operator v0.0.0-20241007204305-35d61aa5aebd/go.mod h1:ICbLstSO4zhYo+SFSciIWO9rLHQg29GJ1335L0tfhR0= github.com/percona/percona-server-mongodb-operator v1.18.0 h1:inRWonCOTacD++D/tvyFXVUqKx7f2OQzz8w1NyT3cAI= From 9aab6ea387cb240df0c6b96ed8d482b0864129fb Mon Sep 17 00:00:00 2001 From: Maxim Kondratenko Date: Sun, 19 Jan 2025 11:46:51 +0200 Subject: [PATCH 2/2] EVEREST-1790 Extend help message for CLI `namespace update` command (#1003) * EVEREST-1790 Extend help message for CLI `namespace update` command * EVEREST-1790 Fix formatting * EVEREST-1795 Extend error message for CLI `namespaces update` command. (#1005) * EVEREST-1795 Extend error message for CLI `namespaces update` command. Add hint how to make namespace managed by Everest * EVEREST-1795 Fix formatting --- commands/namespaces/update.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/commands/namespaces/update.go b/commands/namespaces/update.go index 0cefab7fe..1105594d6 100644 --- a/commands/namespaces/update.go +++ b/commands/namespaces/update.go @@ -2,6 +2,7 @@ package namespaces import ( + "errors" "fmt" "os" @@ -18,10 +19,11 @@ import ( // NewUpdateCommand returns a new command to update an existing namespace. func NewUpdateCommand(l *zap.SugaredLogger) *cobra.Command { cmd := &cobra.Command{ - Use: "update", - Long: "Update an existing Everest namespace", - Short: "Update an existing Everest namespace", - Example: `everestctl update add [NAMESPACE] [FLAGS]`, + Use: "update [flags] NAMESPACES", + Long: "Add database operator to existing namespace managed by Everest", + Short: "Add database operator to existing namespace managed by Everest", + Example: `everestctl namespaces update --operator.mongodb=true --skip-wizard ns-1,ns-2`, + Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { initUpdateViperFlags(cmd) c := &namespaces.NamespaceAddConfig{} @@ -33,10 +35,6 @@ func NewUpdateCommand(l *zap.SugaredLogger) *cobra.Command { bindInstallHelmOpts(c) c.Update = true - if len(args) != 1 { - output.PrintError(fmt.Errorf("invalid number of arguments: expected 1, got %d", len(args)), l, true) - os.Exit(1) - } c.Namespaces = args[0] enableLogging := viper.GetBool("verbose") || viper.GetBool("json") @@ -47,6 +45,12 @@ func NewUpdateCommand(l *zap.SugaredLogger) *cobra.Command { cmd.Flags().Lookup("operator.xtradb-cluster").Changed) if err := c.Populate(cmd.Context(), false, askOperators); err != nil { + if errors.Is(err, namespaces.ErrNamespaceNotManagedByEverest) { + err = fmt.Errorf("%w. HINT: use 'everestctl namespaces add --%s %s' first to make namespace managed by Everest", + err, + cli.FlagTakeNamespaceOwnership, + c.Namespaces) + } output.PrintError(err, l, !enableLogging) os.Exit(1) }