Skip to content

Commit

Permalink
Rename --auto-upgrade to --auto-approve flag for Migration CLI (#…
Browse files Browse the repository at this point in the history
…1149)

Unify auto-approve flag for Migration CLI
  • Loading branch information
pkosiec authored Jul 17, 2023
1 parent a93b984 commit 3a5f715
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/cli/cmd/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func NewMigrate() *cobra.Command {
flags.StringVarP(&opts.Namespace, "namespace", "n", "botkube", "Namespace of Botkube pod")
flags.BoolVarP(&opts.SkipConnect, "skip-connect", "q", false, "Skips connecting to Botkube Cloud after migration")
flags.BoolVar(&opts.SkipOpenBrowser, "skip-open-browser", false, "Skips opening web browser after migration")
flags.BoolVar(&opts.AutoUpgrade, "auto-upgrade", false, "Automatically upgrades Botkube instance without additional prompt")
flags.BoolVarP(&opts.AutoApprove, "auto-approve", "y", false, "Skips interactive approval for upgrading Botkube installation.")
flags.StringVar(&opts.ConfigExporter.Registry, "cfg-exporter-image-registry", "ghcr.io", "Config Exporter job image registry")
flags.StringVar(&opts.ConfigExporter.Repository, "cfg-exporter-image-repo", "kubeshop/botkube-config-exporter", "Config Exporter job image repository")
flags.StringVar(&opts.ConfigExporter.Tag, "cfg-exporter-image-tag", DefaultImageTag, "Config Exporter job image tag")
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/docs/botkube_migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ botkube migrate [OPTIONS] [flags]
### Options

```
--auto-upgrade Automatically upgrades Botkube instance without additional prompt
-y, --auto-approve Skips interactive approval for upgrading Botkube installation.
--cfg-exporter-image-registry string Config Exporter job image registry (default "ghcr.io")
--cfg-exporter-image-repo string Config Exporter job image repository (default "kubeshop/botkube-config-exporter")
--cfg-exporter-image-tag string Config Exporter job image tag (default "v9.99.9-dev")
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func errStateMessage(dashboardURL, instanceID string) string {
}

func shouldUpgradeInstallation(opts Options) (bool, error) {
if opts.AutoUpgrade {
if opts.AutoApprove {
return true, nil
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/migrate/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Options struct {
Label string
SkipConnect bool
SkipOpenBrowser bool
AutoUpgrade bool
AutoApprove bool
ConfigExporter ConfigExporterOptions
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestBotkubeMigration(t *testing.T) {

t.Run("Migrate Discord Botkube to Botkube Cloud", func(t *testing.T) {
cmd := exec.Command(appCfg.BotkubeBinaryPath, "migrate",
"--auto-upgrade",
"--auto-approve",
"--skip-open-browser",
"--verbose",
fmt.Sprintf("--token=%s", token),
Expand Down

0 comments on commit 3a5f715

Please sign in to comment.