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

Commit

Permalink
Merge remote-tracking branch 'origin/EVEREST-495-multi-namespaces' into
Browse files Browse the repository at this point in the history
EVEREST-633-use-pg-stable-channel
  • Loading branch information
recharte committed Feb 7, 2024
2 parents 95f6ff0 + d89b7df commit 7fcf623
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
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.20.0
github.com/operator-framework/operator-lifecycle-manager v0.26.0
github.com/percona/everest-operator v0.6.0-dev1.0.20240205163640-b47371dba0a5
github.com/percona/everest-operator v0.6.0-dev1.0.20240207144724-d5253b875e28
github.com/percona/percona-everest-backend v0.5.1-0.20240205094045-e23451782e1a
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,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.20240205163640-b47371dba0a5 h1:qtLttjvVyc276YEZVdQ/aO8h+/M69Yyj5BcOnTBHY2M=
github.com/percona/everest-operator v0.6.0-dev1.0.20240205163640-b47371dba0a5/go.mod h1:45pGpvWrPy495qiQqxNuOJor4wif+vTTTJP4Qee8qZk=
github.com/percona/everest-operator v0.6.0-dev1.0.20240207144724-d5253b875e28 h1:N9dZVyeXzUTK+xRdz9DBcaWj3X6oUPpezEwdH2jT4cg=
github.com/percona/everest-operator v0.6.0-dev1.0.20240207144724-d5253b875e28/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-everest-backend v0.5.1-0.20240205094045-e23451782e1a h1:2CZcbM4NWnKq3/gE5OySzKMiJhjMwARa6tegJ2XIT48=
Expand Down
2 changes: 1 addition & 1 deletion pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func (o *Install) installOperator(ctx context.Context, channel, operatorName, na
params.SubscriptionConfig = &v1alpha1.SubscriptionConfig{
Env: []corev1.EnvVar{
{
Name: kubernetes.EverestWatchNamespacesEnvVar,
Name: kubernetes.EverestDBNamespacesEnvVar,
Value: strings.Join(o.config.Namespaces, ","),
},
},
Expand Down
11 changes: 6 additions & 5 deletions pkg/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ const (
// EverestOperatorDeploymentName is the name of the deployment for everest operator.
EverestOperatorDeploymentName = "everest-operator-controller-manager"

// EverestWatchNamespacesEnvVar is the name of the environment variable.
EverestWatchNamespacesEnvVar = "WATCH_NAMESPACES"
// EverestDBNamespacesEnvVar is the name of the environment variable that
// contains the list of monitored namespaces.
EverestDBNamespacesEnvVar = "DB_NAMESPACES"

pxcDeploymentName = "percona-xtradb-cluster-operator"
psmdbDeploymentName = "percona-server-mongodb-operator"
Expand Down Expand Up @@ -998,8 +999,8 @@ func (k *Kubernetes) DeleteEverest(ctx context.Context, namespace string) error
return nil
}

// GetWatchedNamespaces returns list of watched namespaces.
func (k *Kubernetes) GetWatchedNamespaces(ctx context.Context, namespace string) ([]string, error) {
// GetDBNamespaces returns a list of namespaces that are monitored by the Everest operator.
func (k *Kubernetes) GetDBNamespaces(ctx context.Context, namespace string) ([]string, error) {
deployment, err := k.GetDeployment(ctx, EverestOperatorDeploymentName, namespace)
if err != nil {
return nil, err
Expand All @@ -1010,7 +1011,7 @@ func (k *Kubernetes) GetWatchedNamespaces(ctx context.Context, namespace string)
continue
}
for _, envVar := range container.Env {
if envVar.Name != EverestWatchNamespacesEnvVar {
if envVar.Name != EverestDBNamespacesEnvVar {
continue
}
return strings.Split(envVar.Value, ","), nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (u *Upgrade) Run(ctx context.Context) error {

func (u *Upgrade) runEverestWizard(ctx context.Context) error {
if !u.config.SkipWizard {
namespaces, err := u.kubeClient.GetWatchedNamespaces(ctx, install.SystemNamespace)
namespaces, err := u.kubeClient.GetDBNamespaces(ctx, install.SystemNamespace)
if err != nil {
return err
}
Expand Down

0 comments on commit 7fcf623

Please sign in to comment.