From 498ae3a3756e71ee18390f4a2882e7e7457eefba Mon Sep 17 00:00:00 2001 From: Ludovic Cleroux Date: Tue, 17 Dec 2024 10:09:12 +0100 Subject: [PATCH] ROX-27131: fix tenant ArgoCD environment variable names --- fleetshard/config/config.go | 6 +++--- fleetshard/pkg/central/reconciler/argo_reconciler.go | 12 ++++++------ fleetshard/pkg/runtime/runtime.go | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fleetshard/config/config.go b/fleetshard/config/config.go index a485d0fa5..48337cb8e 100644 --- a/fleetshard/config/config.go +++ b/fleetshard/config/config.go @@ -36,9 +36,9 @@ type Config struct { // It is required when central images need to fetched from a private Quay registry. // It needs to given as Docker Config JSON object. TenantImagePullSecret string `env:"TENANT_IMAGE_PULL_SECRET"` - DefaultTenantArgoCdAppSourceRepoURL string `env:"DEFAULT_TENANT_ARGOCD_APP_SOURCE_REPO_URL" envDefault:"https://github.com/stackrox/acscs-manifests.git"` - DefaultTenantArgoCdAppSourceTargetRevision string `env:"DEFAULT_TENANT_ARGOCD_APP_SOURCE_TARGET_REVISION" envDefault:"HEAD"` - DefaultTenantArgoCdAppSourcePath string `env:"DEFAULT_TENANT_ARGOCD_APP_SOURCE_PATH" envDefault:"tenant-resources"` + TenantDefaultArgoCdAppSourceRepoURL string `env:"TENANT_DEFAULT_ARGOCD_APP_SOURCE_REPO_URL" envDefault:"https://github.com/stackrox/acscs-manifests.git"` + TenantDefaultArgoCdAppSourceTargetRevision string `env:"TENANT_DEFAULT_ARGOCD_APP_SOURCE_TARGET_REVISION" envDefault:"HEAD"` + TenantDefaultArgoCdAppSourcePath string `env:"TENANT_DEFAULT_ARGOCD_APP_SOURCE_PATH" envDefault:"tenant-resources"` ArgoCdNamespace string `env:"ARGOCD_NAMESPACE" envDefault:"openshift-gitops"` ManagedDB ManagedDB Telemetry Telemetry diff --git a/fleetshard/pkg/central/reconciler/argo_reconciler.go b/fleetshard/pkg/central/reconciler/argo_reconciler.go index f88b144d4..bf9721cbe 100644 --- a/fleetshard/pkg/central/reconciler/argo_reconciler.go +++ b/fleetshard/pkg/central/reconciler/argo_reconciler.go @@ -26,9 +26,9 @@ type argoReconciler struct { // ArgoReconcilerOptions defines configuration options for the Argo application reconiliation type ArgoReconcilerOptions struct { - DefaultTenantArgoCdAppSourceRepoURL string - DefaultTenantArgoCdAppSourceTargetRevision string - DefaultTenantArgoCdAppSourcePath string + TenantDefaultArgoCdAppSourceRepoURL string + TenantDefaultArgoCdAppSourceTargetRevision string + TenantDefaultArgoCdAppSourcePath string ArgoCdNamespace string ManagedDBEnabled bool ClusterName string @@ -158,9 +158,9 @@ func (r *argoReconciler) makeDesiredArgoCDApplication(remoteCentral private.Mana }, }, Source: &argocd.ApplicationSource{ - RepoURL: r.argoOpts.DefaultTenantArgoCdAppSourceRepoURL, - TargetRevision: r.argoOpts.DefaultTenantArgoCdAppSourceTargetRevision, - Path: r.argoOpts.DefaultTenantArgoCdAppSourcePath, + RepoURL: r.argoOpts.TenantDefaultArgoCdAppSourceRepoURL, + TargetRevision: r.argoOpts.TenantDefaultArgoCdAppSourceTargetRevision, + Path: r.argoOpts.TenantDefaultArgoCdAppSourcePath, Helm: &argocd.ApplicationSourceHelm{ ValuesObject: &runtime.RawExtension{ Raw: valuesBytes, diff --git a/fleetshard/pkg/runtime/runtime.go b/fleetshard/pkg/runtime/runtime.go index 77c080309..2c2e74482 100644 --- a/fleetshard/pkg/runtime/runtime.go +++ b/fleetshard/pkg/runtime/runtime.go @@ -132,9 +132,9 @@ func (r *Runtime) Start() error { routesAvailable := r.routesAvailable() argoReconcilerOpts := centralReconciler.ArgoReconcilerOptions{ - DefaultTenantArgoCdAppSourceTargetRevision: r.config.DefaultTenantArgoCdAppSourceTargetRevision, - DefaultTenantArgoCdAppSourcePath: r.config.DefaultTenantArgoCdAppSourcePath, - DefaultTenantArgoCdAppSourceRepoURL: r.config.DefaultTenantArgoCdAppSourceRepoURL, + TenantDefaultArgoCdAppSourceTargetRevision: r.config.TenantDefaultArgoCdAppSourceTargetRevision, + TenantDefaultArgoCdAppSourcePath: r.config.TenantDefaultArgoCdAppSourcePath, + TenantDefaultArgoCdAppSourceRepoURL: r.config.TenantDefaultArgoCdAppSourceRepoURL, ArgoCdNamespace: r.config.ArgoCdNamespace, ManagedDBEnabled: r.config.ManagedDB.Enabled, ClusterName: r.config.ClusterName,