-
Notifications
You must be signed in to change notification settings - Fork 5k
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: Add labels on Application's k8s events (#11381) #18160
base: master
Are you sure you want to change the base?
Conversation
docs/operator-manual/argocd-cm.yaml
Outdated
# the corresponding labels are added on the generated event. | ||
# In case of conflict between labels on Application and AppProject, | ||
# the Application label values are prioritized and added to the event. | ||
resource.eventLabelKeys: team,env |
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.
Wdyt about resource.includeLabelKeys
and resource.excludeLabelKeys
could have wildcards as an improvement - @leoluz
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.
Added new keys resource.includeEventLabelKeys
& resource.excludeEventLabelKeys
.
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 think this is a great start, to make it feature complete can we handle the include/exclude use cases?
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18160 +/- ##
==========================================
+ Coverage 44.93% 44.97% +0.04%
==========================================
Files 354 354
Lines 47742 47793 +51
==========================================
+ Hits 21454 21497 +43
- Misses 23485 23491 +6
- Partials 2803 2805 +2 ☔ View full report in Codecov by Sentry. |
Thanks for @todaywasawesome & @leoluz for your inputs. I have incorporated your suggestions by introducing two new keys |
Closes #11381
This PR implements #11381 enhancement to expose application labels on k8s events generated by Argo CD.
Change:
This PR introduces two new key
resource.includeEventLabelKeys
&resource.excludeEventLabelKeys
inargocd-cm
configmap which takes in a comma separated string of label keys.For any events generated for Applications containing the label keys specified in
resource.includeEventLabelKeys
, the controller adds the matched label onto the event thus establishing an easy link between the event and the application to filter-out/process later using labels. The specified label keys are matched against the Application and it's AppProject labels. In case of conflict between labels on Application and it's AppProject, the Application label values are prioritised and added to the event.Furthermore, labels specified in
resource.excludeEventLabelKeys
are removed from the event labels, if they were included.Sample output:
Checklist: