-
Notifications
You must be signed in to change notification settings - Fork 832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support multiple ArgoCD instances with ApplicationTrackingAnnotations #1637
base: master
Are you sure you want to change the base?
feat: Support multiple ArgoCD instances with ApplicationTrackingAnnotations #1637
Conversation
343db05
to
bd8f847
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sharing the feedback here from our chat for others to be able to advise further as well,
- We do not want to change the name of the config map being created. ArgoCD looks for a specific configMap and if it does not find the configMap, it defaults everything to default values.
- There is a limitation in Operator where we can have only 1 ArgoCD instance per namespace. I can see that you are creating both the ArgoCD instances in the same namespace here. Once you have them created in different namespaces, you would not need to make changes of creating a different configMap here.
Signed-off-by: Atif Ali <[email protected]> resolve diff in bundle Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]> new approach for e2e tests Signed-off-by: Atif Ali <[email protected]> new added annotation tracking Signed-off-by: Atif Ali <[email protected]> create apps Signed-off-by: Atif Ali <[email protected]> linter fix Signed-off-by: Atif Ali <[email protected]> marshals the annotations into JSON for the ConfigMap Signed-off-by: Atif Ali <[email protected]> create apps Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
…nt.go Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
e6cda85
to
68cd075
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got two questions/comments
controllers/argocd/configmap.go
Outdated
// Set tracking method if specified | ||
if cr.Spec.ResourceTrackingMethod != "" { | ||
cm.Data["resource.tracking.method"] = cr.Spec.ResourceTrackingMethod | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things here:
- The resource tracking method is already set further down in this function
- We use contants to refer to ConfigMap keys, and I think the value you have specified here is incorrect too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right on both points. I've removed this redundant code block since the resource tracking method is already being set using:
cm.Data[common.ArgoCDKeyResourceTrackingMethod] = getResourceTrackingMethod(cr)
controllers/argocd/configmap.go
Outdated
// Set tracking annotations directly in the ConfigMap | ||
if cr.Spec.ApplicationTrackingAnnotations != nil { | ||
for key, value := range cr.Spec.ApplicationTrackingAnnotations { | ||
cm.Data[key] = value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this, to be honest. Why are you setting arbitrary ConfigMap keys here from the Annotations configuration?
Signed-off-by: Atif Ali <[email protected]>
…otations Signed-off-by: Atif Ali <[email protected]>
…tion Signed-off-by: Atif Ali <[email protected]>
Signed-off-by: Atif Ali <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @iam-veeramalla or @svghadi , you might want to take a look as well.
What type of PR is this?
What does this PR do / why we need it:
add ApplicationTrackingAnnotations to prevent resource conflicts between ArgoCD instances
Have you updated the necessary documentation?
Which issue(s) this PR fixes:
see this PR on argocd repo
Fixes #?
How to test changes / Special notes to the reviewer: