From 0d42cdf3da91798a76c533801c7aef6c777158cf Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 16 Feb 2024 15:45:34 +0200 Subject: [PATCH 1/4] fix wizard --- pkg/install/install.go | 1 + pkg/upgrade/upgrade.go | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pkg/install/install.go b/pkg/install/install.go index c2a48b25..1b0125df 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -356,6 +356,7 @@ func (o *Install) runEverestWizard() error { if err != nil { return err } + o.config.Namespaces = namespaces o.config.NamespacesList = list return nil diff --git a/pkg/upgrade/upgrade.go b/pkg/upgrade/upgrade.go index 3cbd1d28..0399fb68 100644 --- a/pkg/upgrade/upgrade.go +++ b/pkg/upgrade/upgrade.go @@ -22,6 +22,7 @@ import ( "fmt" "net/url" "os" + "strings" "github.com/AlecAivazis/survey/v2" goversion "github.com/hashicorp/go-version" @@ -117,13 +118,22 @@ func (u *Upgrade) runEverestWizard(ctx context.Context) error { Message: "Please select namespaces", Options: namespaces, } + + var input []string if err := survey.AskOne( pNamespace, - &u.config.Namespaces, + &input, survey.WithValidator(survey.MinItems(1)), ); err != nil { return err } + + u.config.Namespaces = strings.Join(input, ",") + list, err := install.ValidateNamespaces(u.config.Namespaces) + if err != nil { + return err + } + u.config.NamespacesList = list } return nil From cca423fcf3ba926b5a690200310ea35cd82fe60c Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 16 Feb 2024 15:55:27 +0200 Subject: [PATCH 2/4] versions --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7a99e1db..fd755f96 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/operator-framework/api v0.22.0 github.com/operator-framework/operator-lifecycle-manager v0.26.0 - github.com/percona/everest-operator v0.6.0-dev1.0.20240214112044-8f2dea595284 + github.com/percona/everest-operator v0.6.0-dev1.0.20240216104532-d90d04937fd8 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.8.4 diff --git a/go.sum b/go.sum index cfd94bf4..2be6a3d0 100644 --- a/go.sum +++ b/go.sum @@ -525,8 +525,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/percona/everest-operator v0.6.0-dev1.0.20240214112044-8f2dea595284 h1:5LKWEvGtaimDPVI3Rj9tFxO+g/zAjUJq0yFIzznQGfc= -github.com/percona/everest-operator v0.6.0-dev1.0.20240214112044-8f2dea595284/go.mod h1:45pGpvWrPy495qiQqxNuOJor4wif+vTTTJP4Qee8qZk= +github.com/percona/everest-operator v0.6.0-dev1.0.20240216104532-d90d04937fd8 h1:wUZTZ3tsRc3BW6/PEVjQ3fJ89fAxUEJBNnRFoxBAEbo= +github.com/percona/everest-operator v0.6.0-dev1.0.20240216104532-d90d04937fd8/go.mod h1:45pGpvWrPy495qiQqxNuOJor4wif+vTTTJP4Qee8qZk= github.com/percona/percona-backup-mongodb v1.8.1-0.20230920143330-3b1c2e263901 h1:BDgsZRCjEuxl2/z4yWBqB0s8d20shuIDks7/RVdZiLs= github.com/percona/percona-backup-mongodb v1.8.1-0.20230920143330-3b1c2e263901/go.mod h1:fZRCMpUqkWlLVdRKqqaj001LoVP2eo6F0ZhoMPeXDng= github.com/percona/percona-postgresql-operator v0.0.0-20231220140959-ad5eef722609 h1:+UOK4gcHrRgqjo4smgfwT7/0apF6PhAJdQIdAV4ub/M= From 458d95427b8a66bd3c3aa5404f8213716f6527a2 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 16 Feb 2024 17:10:21 +0200 Subject: [PATCH 3/4] remove duplicate --- pkg/upgrade/upgrade.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/upgrade/upgrade.go b/pkg/upgrade/upgrade.go index 0399fb68..2a9f3b21 100644 --- a/pkg/upgrade/upgrade.go +++ b/pkg/upgrade/upgrade.go @@ -127,13 +127,7 @@ func (u *Upgrade) runEverestWizard(ctx context.Context) error { ); err != nil { return err } - u.config.Namespaces = strings.Join(input, ",") - list, err := install.ValidateNamespaces(u.config.Namespaces) - if err != nil { - return err - } - u.config.NamespacesList = list } return nil From 66c66a35b06fa3561d12548e62183921cc88170d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 16 Feb 2024 17:13:24 +0200 Subject: [PATCH 4/4] operator version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index fd755f96..799b85a7 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/hashicorp/go-version v1.6.0 github.com/operator-framework/api v0.22.0 github.com/operator-framework/operator-lifecycle-manager v0.26.0 - github.com/percona/everest-operator v0.6.0-dev1.0.20240216104532-d90d04937fd8 + github.com/percona/everest-operator v0.6.0-dev1.0.20240216145455-647ba87146d4 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.8.4 diff --git a/go.sum b/go.sum index 2be6a3d0..96a7ee38 100644 --- a/go.sum +++ b/go.sum @@ -525,8 +525,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/percona/everest-operator v0.6.0-dev1.0.20240216104532-d90d04937fd8 h1:wUZTZ3tsRc3BW6/PEVjQ3fJ89fAxUEJBNnRFoxBAEbo= -github.com/percona/everest-operator v0.6.0-dev1.0.20240216104532-d90d04937fd8/go.mod h1:45pGpvWrPy495qiQqxNuOJor4wif+vTTTJP4Qee8qZk= +github.com/percona/everest-operator v0.6.0-dev1.0.20240216145455-647ba87146d4 h1:nc8t3swfbQAIQeZhOhtDlGrAoP50I7wcJ1VIpK8DJLw= +github.com/percona/everest-operator v0.6.0-dev1.0.20240216145455-647ba87146d4/go.mod h1:45pGpvWrPy495qiQqxNuOJor4wif+vTTTJP4Qee8qZk= github.com/percona/percona-backup-mongodb v1.8.1-0.20230920143330-3b1c2e263901 h1:BDgsZRCjEuxl2/z4yWBqB0s8d20shuIDks7/RVdZiLs= github.com/percona/percona-backup-mongodb v1.8.1-0.20230920143330-3b1c2e263901/go.mod h1:fZRCMpUqkWlLVdRKqqaj001LoVP2eo6F0ZhoMPeXDng= github.com/percona/percona-postgresql-operator v0.0.0-20231220140959-ad5eef722609 h1:+UOK4gcHrRgqjo4smgfwT7/0apF6PhAJdQIdAV4ub/M=