-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Conversation
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?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18160 +/- ##
==========================================
+ Coverage 45.09% 45.13% +0.04%
==========================================
Files 354 354
Lines 48006 48057 +51
==========================================
+ Hits 21648 21691 +43
- Misses 23544 23550 +6
- Partials 2814 2816 +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 |
b92fe9a
to
5564f2b
Compare
Signed-off-by: Siddhesh Ghadi <[email protected]>
Signed-off-by: Siddhesh Ghadi <[email protected]>
Signed-off-by: Siddhesh Ghadi <[email protected]>
Signed-off-by: Siddhesh Ghadi <[email protected]>
Signed-off-by: Siddhesh Ghadi <[email protected]>
5564f2b
to
577eafd
Compare
Signed-off-by: Siddhesh Ghadi <[email protected]>
@@ -939,7 +939,7 @@ func (ctrl *ApplicationController) processAppOperationQueueItem() (processNext b | |||
Message: err.Error(), | |||
}) | |||
message := fmt.Sprintf("Unable to delete application resources: %v", err.Error()) | |||
ctrl.auditLogger.LogAppEvent(app, argo.EventInfo{Reason: argo.EventReasonStatusRefreshed, Type: v1.EventTypeWarning}, message, "") | |||
ctrl.logAppEvent(app, argo.EventInfo{Reason: argo.EventReasonStatusRefreshed, Type: v1.EventTypeWarning}, message, context.TODO()) |
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.
Was wondering if we had a better context than the TODO()
one here and elsewhere.
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. @todaywasawesome are your concerns addressed?
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!!
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.
Great! Thanks for getting this over the line.
…oj#18160) * Add labels on Application's k8s events Signed-off-by: Siddhesh Ghadi <[email protected]> * Fix typo Signed-off-by: Siddhesh Ghadi <[email protected]> * Add new cm keys & doc Signed-off-by: Siddhesh Ghadi <[email protected]> * Fix typo Signed-off-by: Siddhesh Ghadi <[email protected]> * correct rebase changes Signed-off-by: Siddhesh Ghadi <[email protected]> * Fix linting Signed-off-by: Siddhesh Ghadi <[email protected]> --------- Signed-off-by: Siddhesh Ghadi <[email protected]>
…oj#18160) * Add labels on Application's k8s events Signed-off-by: Siddhesh Ghadi <[email protected]> * Fix typo Signed-off-by: Siddhesh Ghadi <[email protected]> * Add new cm keys & doc Signed-off-by: Siddhesh Ghadi <[email protected]> * Fix typo Signed-off-by: Siddhesh Ghadi <[email protected]> * correct rebase changes Signed-off-by: Siddhesh Ghadi <[email protected]> * Fix linting Signed-off-by: Siddhesh Ghadi <[email protected]> --------- Signed-off-by: Siddhesh Ghadi <[email protected]> Signed-off-by: Javier Solana <[email protected]> Signed-off-by: Javier Solana <[email protected]>
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: