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

Commit

Permalink
Remove namespace flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Kralik committed Feb 28, 2024
1 parent 9eeb4b9 commit 66ce00b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions commands/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func initUpgradeFlags(cmd *cobra.Command) {
cmd.Flags().String("everest.endpoint", "http://127.0.0.1:8080", "Everest endpoint URL")
cmd.Flags().String("everest.token", "", "Everest token to authenticate against Everest")
cmd.Flags().StringP("kubeconfig", "k", "~/.kube/config", "Path to a kubeconfig")
cmd.Flags().String("namespace", "everest-system", "Namespace where Everest is installed")
cmd.Flags().String("version-metadata-url", "https://check.percona.com", "URL to retrieve version metadata information from")
}

Expand All @@ -81,7 +80,6 @@ func initUpgradeViperFlags(cmd *cobra.Command) {
viper.BindPFlag("everest.token", cmd.Flags().Lookup("everest.token")) //nolint:errcheck,gosec
viper.BindEnv("kubeconfig") //nolint:errcheck,gosec
viper.BindPFlag("kubeconfig", cmd.Flags().Lookup("kubeconfig")) //nolint:errcheck,gosec
viper.BindPFlag("namespace", cmd.Flags().Lookup("namespace")) //nolint:errcheck,gosec
viper.BindPFlag("version-metadata-url", cmd.Flags().Lookup("version-metadata-url")) //nolint:errcheck,gosec
}

Expand Down
7 changes: 3 additions & 4 deletions pkg/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"go.uber.org/zap"
"k8s.io/apimachinery/pkg/types"

"github.com/percona/percona-everest-cli/pkg/install"
"github.com/percona/percona-everest-cli/pkg/kubernetes"
cliVersion "github.com/percona/percona-everest-cli/pkg/version"
)
Expand All @@ -43,8 +44,6 @@ type (

// KubeconfigPath is a path to a kubeconfig
KubeconfigPath string `mapstructure:"kubeconfig"`
// Namespace holds namespace where Everest is installed.
Namespace string
// VersionMetadataURL stores hostname to retrieve version metadata information from.
VersionMetadataURL string `mapstructure:"version-metadata-url"`
}
Expand Down Expand Up @@ -112,8 +111,8 @@ func (u *Upgrade) Run(ctx context.Context) error {
return err
}

u.l.Infof("Upgrading Everest to %s in namespace %s", upgradeEverestTo, u.config.Namespace)
if err := u.kubeClient.InstallEverest(ctx, u.config.Namespace, upgradeEverestTo); err != nil {
u.l.Infof("Upgrading Everest to %s in namespace %s", upgradeEverestTo, install.SystemNamespace)
if err := u.kubeClient.InstallEverest(ctx, install.SystemNamespace, upgradeEverestTo); err != nil {
return err
}

Expand Down

0 comments on commit 66ce00b

Please sign in to comment.