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

Add an event recorder for Admission Check Controller #1271

Merged
merged 4 commits into from Nov 14, 2023

Conversation

stuton
Copy link
Contributor

@stuton stuton commented Oct 26, 2023

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?

Add events for transitions of the provisioning AdmissionCheck

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 26, 2023
@netlify
Copy link

netlify bot commented Oct 26, 2023

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 53a8d24
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/65534f2c67feb1000881ea11

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 26, 2023
@alculquicondor
Copy link
Contributor

/assign @mimowo

Comment on lines 455 to 456
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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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/core/workload_controller.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2023
cmd/kueue/main.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)
Copy link
Contributor

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.

pkg/controller/admissionchecks/provisioning/controller.go Outdated Show resolved Hide resolved
pkg/controller/core/workload_controller.go Outdated Show resolved Hide resolved
pkg/controller/core/workload_controller.go Outdated Show resolved Hide resolved
@alculquicondor
Copy link
Contributor

/assign @trasc

Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Nov 14, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 28fd6aad35a979621c0b92f3b01cf88561f8ff32

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 14, 2023
@k8s-ci-robot k8s-ci-robot merged commit e7bb101 into kubernetes-sigs:main Nov 14, 2023
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.6 milestone Nov 14, 2023
@alculquicondor
Copy link
Contributor

/release-note-edit

Add events for transitions of the provisioning AdmissionCheck

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Dec 1, 2023
@alculquicondor
Copy link
Contributor

/cherry-pick

@alculquicondor
Copy link
Contributor

/cherry-pick release-0.5

@k8s-infra-cherrypick-robot

@alculquicondor: new pull request created: #1394

In response to this:

/cherry-pick release-0.5

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.

@trasc trasc deleted the recorder-admission-checks branch May 23, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Provisioning ACC] Add an event recorder.
6 participants