Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

EVEREST-855 Namespaces list fix for wizard #300

Merged
merged 4 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
1 change: 1 addition & 0 deletions pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func (o *Install) runEverestWizard() error {
if err != nil {
return err
}
o.config.Namespaces = namespaces
o.config.NamespacesList = list

return nil
Expand Down
12 changes: 11 additions & 1 deletion pkg/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"net/url"
"os"
"strings"

"github.com/AlecAivazis/survey/v2"
goversion "github.com/hashicorp/go-version"
Expand Down Expand Up @@ -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
Expand Down
Loading