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

Commit

Permalink
EVEREST-633 update namespaces env var name
Browse files Browse the repository at this point in the history
  • Loading branch information
recharte committed Feb 7, 2024
1 parent 7eecfb4 commit 1972bc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
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 1972bc6

Please sign in to comment.