Skip to content
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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

aali309
Copy link
Contributor

@aali309 aali309 commented Jan 8, 2025

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?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:
see this PR on argocd repo
Fixes #?

How to test changes / Special notes to the reviewer:

@aali309 aali309 force-pushed the ApplicationTrackingAnnotations branch from 343db05 to bd8f847 Compare January 8, 2025 22:41
Copy link
Collaborator

@ishitasequeira ishitasequeira left a 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.

@aali309 aali309 marked this pull request as ready for review January 29, 2025 19:18
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]>
@aali309 aali309 force-pushed the ApplicationTrackingAnnotations branch from e6cda85 to 68cd075 Compare February 1, 2025 05:22
Copy link
Collaborator

@jannfis jannfis left a 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

Comment on lines 386 to 389
// Set tracking method if specified
if cr.Spec.ResourceTrackingMethod != "" {
cm.Data["resource.tracking.method"] = cr.Spec.ResourceTrackingMethod
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things here:

  1. The resource tracking method is already set further down in this function
  2. We use contants to refer to ConfigMap keys, and I think the value you have specified here is incorrect too

Copy link
Contributor Author

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)

// Set tracking annotations directly in the ConfigMap
if cr.Spec.ApplicationTrackingAnnotations != nil {
for key, value := range cr.Spec.ApplicationTrackingAnnotations {
cm.Data[key] = value
Copy link
Collaborator

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?

@aali309 aali309 requested a review from jannfis February 4, 2025 14:09
Copy link
Collaborator

@jannfis jannfis left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants