Skip to content

Commit 1688146

Browse files
committed
reused argocd-operator's env variables
Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
1 parent 2ec5e6b commit 1688146

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

common/common.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ const (
3131
DefaultConsoleVersion = "v0.1.0"
3232
// Default console plugin installation OCP version
3333
DefaultDynamicPluginStartOCPVersion = "4.15.0"
34-
// ArgoCDLabelSelector is an env variable used for filtering ArgoCD instances to be reconciled.
35-
ArgoCDLabelSelector = "ARGOCD_LABEL_SELECTOR"
36-
// DefaultArgoCDLabelSelector is used when the ARGOCD_LABEL_SELECTOR is not specified or is empty.
37-
DefaultArgoCDLabelSelector = ""
3834
)
3935

4036
// InfraNodeSelector returns openshift label for infrastructure nodes

main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,11 @@ import (
2929
"go.uber.org/zap/zapcore"
3030
_ "k8s.io/client-go/plugin/pkg/client/auth"
3131

32-
"k8s.io/apimachinery/pkg/labels"
33-
"k8s.io/apimachinery/pkg/runtime"
34-
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
35-
3632
rolloutManagerApi "github.com/argoproj-labs/argo-rollouts-manager/api/v1alpha1"
3733
rolloutManagerProvisioner "github.com/argoproj-labs/argo-rollouts-manager/controllers"
3834
argov1alpha1api "github.com/argoproj-labs/argocd-operator/api/v1alpha1"
3935
argov1beta1api "github.com/argoproj-labs/argocd-operator/api/v1beta1"
36+
argocdcommon "github.com/argoproj-labs/argocd-operator/common"
4037
argocdprovisioner "github.com/argoproj-labs/argocd-operator/controllers/argocd"
4138
"github.com/argoproj/argo-cd/v2/util/env"
4239
monitoringv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
@@ -48,6 +45,9 @@ import (
4845
templatev1 "github.com/openshift/api/template/v1"
4946
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
5047
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
48+
"k8s.io/apimachinery/pkg/labels"
49+
"k8s.io/apimachinery/pkg/runtime"
50+
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
5151
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
5252
ctrl "sigs.k8s.io/controller-runtime"
5353
"sigs.k8s.io/controller-runtime/pkg/healthz"
@@ -89,7 +89,7 @@ func main() {
8989
var labelSelectorFlag string
9090
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
9191
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
92-
flag.StringVar(&labelSelectorFlag, "label-selector", env.StringFromEnv(common.ArgoCDLabelSelector, common.DefaultArgoCDLabelSelector), "The label selector is used to map to a subset of ArgoCD instances to reconcile")
92+
flag.StringVar(&labelSelectorFlag, "label-selector", env.StringFromEnv(argocdcommon.ArgoCDLabelSelectorKey, argocdcommon.ArgoCDDefaultLabelSelector), "The label selector is used to map to a subset of ArgoCD instances to reconcile")
9393
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
9494
"Enable leader election for controller manager. "+
9595
"Enabling this will ensure there is only one active controller manager.")

0 commit comments

Comments
 (0)