Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import (
argocdcommon "github.com/argoproj-labs/argocd-operator/common"
argocdprovisioner "github.com/argoproj-labs/argocd-operator/controllers/argocd"
notificationsprovisioner "github.com/argoproj-labs/argocd-operator/controllers/notificationsconfiguration"
"github.com/argoproj-labs/argocd-operator/pkg/cacheutils"
wc "github.com/argoproj-labs/argocd-operator/pkg/clientwrapper"
appsv1 "github.com/openshift/api/apps/v1"
configv1 "github.com/openshift/api/config/v1"
console "github.com/openshift/api/console/v1"
Expand All @@ -46,11 +48,14 @@ import (
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
corev1 "k8s.io/api/core/v1"
crdv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/labels"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
crclient "sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
controllerconfig "sigs.k8s.io/controller-runtime/pkg/config"
"sigs.k8s.io/controller-runtime/pkg/healthz"
Expand Down Expand Up @@ -156,12 +161,22 @@ func main() {
Controller: controllerconfig.Controller{
SkipNameValidation: &skipControllerNameValidation,
},
Cache: cache.Options{
Scheme: scheme,
ByObject: map[crclient.Object]cache.ByObject{
&corev1.Secret{}: {Transform: cacheutils.StripSecretDataTranform()},
&corev1.ConfigMap{}: {Transform: cacheutils.StripConfigMapDataTransform()},
},
},
})
if err != nil {
setupLog.Error(err, "unable to start manager")
os.Exit(1)
}

liveClient, _ := crclient.New(ctrl.GetConfigOrDie(), crclient.Options{Scheme: mgr.GetScheme()})
client := wc.NewClientWrapper(mgr.GetClient(), liveClient)

registerComponentOrExit(mgr, console.AddToScheme)
registerComponentOrExit(mgr, routev1.AddToScheme) // Adding the routev1 api
registerComponentOrExit(mgr, operatorsv1.AddToScheme)
Expand All @@ -185,7 +200,7 @@ func main() {
}

if err = (&controllers.ReconcileGitopsService{
Client: mgr.GetClient(),
Client: client,
Scheme: mgr.GetScheme(),
DisableDefaultInstall: strings.ToLower(os.Getenv(common.DisableDefaultInstallEnvVar)) == "true",
}).SetupWithManager(mgr); err != nil {
Expand All @@ -194,15 +209,15 @@ func main() {
}

if err = (&controllers.ReconcileArgoCDRoute{
Client: mgr.GetClient(),
Client: client,
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Argo CD route")
os.Exit(1)
}

if err = (&controllers.ArgoCDMetricsReconciler{
Client: mgr.GetClient(),
Client: client,
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Argo CD metrics")
Expand All @@ -224,7 +239,7 @@ func main() {
argocdprovisioner.Register(openshift.ReconcilerHook, openshift.BuilderHook)

if err = (&argocdprovisioner.ReconcileArgoCD{
Client: mgr.GetClient(),
Client: client,
Scheme: mgr.GetScheme(),
LabelSelector: labelSelectorFlag,
K8sClient: k8sClient,
Expand All @@ -245,7 +260,7 @@ func main() {
}

if err = (&rolloutManagerProvisioner.RolloutManagerReconciler{
Client: mgr.GetClient(),
Client: client,
Scheme: mgr.GetScheme(),
OpenShiftRoutePluginLocation: getArgoRolloutsOpenshiftRouteTrafficManagerPath(),
NamespaceScopedArgoRolloutsController: isNamespaceScoped,
Expand All @@ -255,7 +270,7 @@ func main() {
}

if err = (&notificationsprovisioner.NotificationsConfigurationReconciler{
Client: mgr.GetClient(),
Client: client,
Scheme: mgr.GetScheme(),
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Notifications Configuration")
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/redhat-developer/gitops-operator

go 1.24.4
go 1.24.6

require (
github.com/argoproj-labs/argo-rollouts-manager v0.0.6-0.20250731075119-a100fc1d88b8
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20250825094300-73f08c092df7
github.com/argoproj/argo-cd/v3 v3.1.0-rc2
github.com/argoproj/argo-cd/v3 v3.1.1
github.com/argoproj/gitops-engine v0.7.1-0.20250617174952-093aef0dad58
github.com/go-logr/logr v1.4.3
github.com/google/go-cmp v0.7.0
Expand Down Expand Up @@ -177,6 +177,7 @@ require (
)

replace (
github.com/argoproj-labs/argocd-operator => github.com/svghadi/argocd-operator v0.0.0-20250911100339-f1adb7807ced
github.com/golang/protobuf => github.com/golang/protobuf v1.5.4
github.com/grpc-ecosystem/grpc-gateway => github.com/grpc-ecosystem/grpc-gateway v1.16.0

Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/argoproj-labs/argo-rollouts-manager v0.0.6-0.20250731075119-a100fc1d88b8 h1:6+eo7BKrNkSIhQ1nnyCUloSNrGzghlb8r8e7GokoeBo=
github.com/argoproj-labs/argo-rollouts-manager v0.0.6-0.20250731075119-a100fc1d88b8/go.mod h1:yTwzKUV79YyI764hkXdVojGYBA9yKJk3qXx5mRuQ2Xc=
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20250825094300-73f08c092df7 h1:Y7UmKUW707B7xVLjfnBVkQgM00Dmi7JOCxB9WZ092zE=
github.com/argoproj-labs/argocd-operator v0.14.0-rc1.0.20250825094300-73f08c092df7/go.mod h1:7zgj/iHFq1r1OZmLX9yxUAarttxnklMbqZb/63euXA8=
github.com/argoproj/argo-cd/v3 v3.1.0-rc2 h1:oT9whFw3tShGkW1WrHJReFkAJvmsgS2KGJkcRIFSnt8=
github.com/argoproj/argo-cd/v3 v3.1.0-rc2/go.mod h1:vrxw1sapzdI3nnkwRKP84cMTzYjOKP7XsEy5fW1FQgg=
github.com/argoproj/argo-cd/v3 v3.1.1 h1:5qzZUtfpHTwrySprpQwpvjPUHKUz7gBs/wK7PSiVQ8I=
github.com/argoproj/argo-cd/v3 v3.1.1/go.mod h1:QqvzXzddclRLN7m9XrMb1SM6rOTFP9druSh7wrapZbw=
github.com/argoproj/gitops-engine v0.7.1-0.20250617174952-093aef0dad58 h1:9ESamu44v3dR9j/I4/4Aa1Fx3QSIE8ElK1CR8Z285uk=
github.com/argoproj/gitops-engine v0.7.1-0.20250617174952-093aef0dad58/go.mod h1:aIBEG3ohgaC1gh/sw2On6knkSnXkqRLDoBj234Dqczw=
github.com/argoproj/pkg v0.13.7-0.20250305113207-cbc37dc61de5 h1:YBoLSjpoaJXaXAldVvBRKJuOPvIXz9UOv6S96gMJM/Q=
Expand Down Expand Up @@ -360,6 +358,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/svghadi/argocd-operator v0.0.0-20250911100339-f1adb7807ced h1:YI5YNipo67ZpJU9RHW6v/ySNK11pUmGKlK/c1e4xYBo=
github.com/svghadi/argocd-operator v0.0.0-20250911100339-f1adb7807ced/go.mod h1:fhN/hOiIuSANIgYxF3sxjVfTbj7MR9pkp73om6zYKMA=
github.com/vmihailenco/go-tinylfu v0.2.2 h1:H1eiG6HM36iniK6+21n9LLpzx1G9R3DJa2UjUjbynsI=
github.com/vmihailenco/go-tinylfu v0.2.2/go.mod h1:CutYi2Q9puTxfcolkliPq4npPuofg9N9t8JVrjzwa3Q=
github.com/vmihailenco/msgpack/v5 v5.3.4/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
Expand Down