-
Notifications
You must be signed in to change notification settings - Fork 228
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
Add an event recorder for Admission Check Controller #1271
Add an event recorder for Admission Check Controller #1271
Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
bf3be87
to
d7ec831
Compare
/assign @mimowo |
c.record.Eventf(wl, corev1.EventTypeNormal, "UpdatedWorkload", "Updated admission checks state for workload %s", workload.Key(wl)) | ||
return c.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(ControllerName), client.ForceOwnership) |
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.
c.record.Eventf(wl, corev1.EventTypeNormal, "UpdatedWorkload", "Updated admission checks state for workload %s", workload.Key(wl)) | |
return c.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(ControllerName), client.ForceOwnership) | |
err := c.client.Status().Patch(ctx, wlPatch, client.Apply, client.FieldOwner(ControllerName), client.ForceOwnership) | |
if err != nil { | |
return err | |
} | |
c.record.Eventf(wl, corev1.EventTypeNormal, "UpdatedWorkload", "Updated admission checks state for workload %s", workload.Key(wl)) |
"UpdatedWorkload" is a bit too generic, we should record what happened also.
- A workload can have multiple admission checks managed by this controller, we should record the check as well.
pkg/controller/admissionchecks/provisioning/admissioncheck_reconciler.go
Outdated
Show resolved
Hide resolved
9924324
to
77d6a65
Compare
77d6a65
to
61a8447
Compare
pkg/controller/admissionchecks/provisioning/admissioncheck_reconciler.go
Outdated
Show resolved
Hide resolved
@@ -431,9 +436,19 @@ func (c *Controller) syncCheckStates(ctx context.Context, wl *kueue.Workload, ch | |||
} | |||
} | |||
workload.SetAdmissionCheckState(&wlPatch.Status.AdmissionChecks, checkState) |
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.
we should only report events if the status of this check changed.
/assign @trasc |
test/integration/controller/admissionchecks/provisioning/suite_test.go
Outdated
Show resolved
Hide resolved
e27ddfa
to
01bfe49
Compare
01bfe49
to
53a8d24
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.
/lgtm
/approve
/label tide/merge-method-squash
LGTM label has been added. Git tree hash: 28fd6aad35a979621c0b92f3b01cf88561f8ff32
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, stuton The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/release-note-edit
|
/cherry-pick |
/cherry-pick release-0.5 |
@alculquicondor: new pull request created: #1394 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add an event recorder for Admission Check Controller
Which issue(s) this PR fixes:
Fixes #1246
Special notes for your reviewer:
Does this PR introduce a user-facing change?