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

ApplicationSet: Allow preserving state of custom annotations #12507

Closed
lacarvalho91 opened this issue Feb 17, 2023 · 0 comments · Fixed by #12408
Closed

ApplicationSet: Allow preserving state of custom annotations #12507

lacarvalho91 opened this issue Feb 17, 2023 · 0 comments · Fixed by #12408
Labels
enhancement New feature or request

Comments

@lacarvalho91
Copy link
Contributor

lacarvalho91 commented Feb 17, 2023

Summary

An ApplicationSet should be able to be configured to allow preserving the state of custom annotations. This is already hard-coded for the Argo CD Notifications and the Argo CD refresh type annotations, the reason this was done for those can also apply to custom annotations.

Motivation

I'm using a custom plugin that patches the Application being refreshed with some context that is only available at refresh time. I need that context to be available to Argo CD Notifications (and other external systems) so I am storing that context in a custom annotation. The problem now is that the ApplicationSet controller will remove the annotation as it isn't defined on the ApplicationSet. Its a common pattern for operators and such to use custom annotations to keep some state, as seen by the annotations Argo CD itself uses.

Proposal

I propose adding a new field to the ApplicationSet that allows users to configure annotations that should be preserved. This would look something like: preservedFields.annotations: ["custom-anno"]. This structure can be evolved in the future to support preserving other fields (labels could be a good candidate), though you may want to avoid allowing arbitrary fields to be preserved.

@lacarvalho91 lacarvalho91 added the enhancement New feature or request label Feb 17, 2023
crenshaw-dev pushed a commit that referenced this issue Mar 10, 2023
#12507) (#12408)

* feat: Support configuring annotations that are preserved by the AppSet

Signed-off-by: Lawrence Carvalho <lacarvalho91@gmail.com>
Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>

* Docs

Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>

* Retrigger CI pipeline

Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>

---------

Signed-off-by: Lawrence Carvalho <lacarvalho91@gmail.com>
Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this issue Aug 9, 2023
argoproj#12507) (argoproj#12408)

* feat: Support configuring annotations that are preserved by the AppSet

Signed-off-by: Lawrence Carvalho <lacarvalho91@gmail.com>
Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>

* Docs

Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>

* Retrigger CI pipeline

Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>

---------

Signed-off-by: Lawrence Carvalho <lacarvalho91@gmail.com>
Signed-off-by: Lawrence Carvalho <lawrence.carvalho@sky.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant