Prevent SCM-Manager Argo CD Tracking Collisions in Multi-Tenant Setups#505
Open
avetgit wants to merge 15 commits into
Open
Prevent SCM-Manager Argo CD Tracking Collisions in Multi-Tenant Setups#505avetgit wants to merge 15 commits into
avetgit wants to merge 15 commits into
Conversation
…namespace pruning
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts SCM-Manager/Argo CD naming and bootstrap behavior to avoid Argo CD tracking collisions in prefixed/multi-tenant setups, and fixes Kubernetes ConfigMap retrieval to use the client’s active namespace.
Changes:
- Update
K8sClient.getConfigMap()to read ConfigMaps fromclient.namespace(fallback to default). - Prefix SCM-Manager Helm/ArgoCD release/service naming using
config.application.namePrefix, and update related URL resolution + tests. - Change Argo CD Application generation to (a) prefix
metadata.nameto avoid tracking collisions and (b) special-case SCM-Manager as a bootstrap app (embed Helm values; no self-referencing values git source); also set Argo CD resource tracking method toannotation.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/main/groovy/com/cloudogu/gitops/infrastructure/kubernetes/api/K8sClient.groovy | Read ConfigMaps from the client’s effective namespace instead of always default. |
| src/test/groovy/com/cloudogu/gitops/infrastructure/kubernetes/api/K8sClientTest.groovy | Align tests with namespace-aware ConfigMap retrieval (test namespace from mock client). |
| src/main/groovy/com/cloudogu/gitops/tools/core/scmmanager/ScmManagerSetup.groovy | Compute SCM-Manager Helm/ArgoCD release name from namePrefix and pass into deployment + templating. |
| src/main/groovy/com/cloudogu/gitops/tools/core/scmmanager/ScmManager.groovy | Pass config into ScmManagerSetup constructor. |
| src/test/groovy/com/cloudogu/gitops/tools/core/ScmManagerSetupTest.groovy | Update expectations for prefixed SCM-Manager release name. |
| src/main/groovy/com/cloudogu/gitops/infrastructure/git/providers/scmmanager/ScmManagerUrlResolver.groovy | Resolve SCM-Manager service DNS/NodePort using prefixed service/release name. |
| src/test/groovy/com/cloudogu/gitops/infrastructure/git/providers/scmmanager/ScmManagerUrlResolverTest.groovy | Update URL resolver tests for prefixed SCM-Manager service name. |
| src/main/groovy/com/cloudogu/gitops/infrastructure/deployment/ArgoCdApplicationStrategy.groovy | Prefix ArgoCD Application metadata.name, add SCM-Manager bootstrap behavior (single source + embedded values). |
| src/test/groovy/com/cloudogu/gitops/infrastructure/deployment/ArgoCdApplicationStrategyTest.groovy | Update expected Application name and add bootstrap test for SCM-Manager sources behavior. |
| src/main/groovy/com/cloudogu/gitops/application/orchestration/GitHandler.groovy | Rename/clarify internal SCM bootstrap skip logic and add more logging around repository setup decisions. |
| argocd/cluster-resources/apps/argocd/operator/argocd.ftl.yaml | Configure Argo CD operator application.resourceTrackingMethod: annotation. |
| argocd/cluster-resources/apps/argocd/argocd/values.ftl.yaml | Configure Helm-based Argo CD cm.application.resourceTrackingMethod: annotation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request overview
Adjusts SCM-Manager/Argo CD naming and bootstrap behavior to avoid Argo CD tracking collisions in prefixed/multi-tenant setups, and fixes Kubernetes ConfigMap retrieval to use the client’s active namespace.
Changes:
K8sClient.getConfigMap()to read ConfigMaps fromclient.namespace(fallback to default).config.application.namePrefix, and update related URL resolution + tests.metadata.nameto avoid tracking collisions and (b) special-case SCM-Manager as a bootstrap app (embed Helm values; no self-referencing values git source); also set Argo CD resource tracking method toannotation.