Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Added EventRecorder to the Controller #101

Merged
merged 17 commits into from
May 16, 2024

Conversation

shanduur
Copy link
Contributor

@shanduur shanduur commented Oct 18, 2023

During one of the SIG-Storage COSI meetings in February we discussed adding Event recording capabilities.

This is 2nd out of 3 pull requests across all repos (api/controller/provisioner-sidecar) with implementation of those changes.

Ref:

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 18, 2023
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 18, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @shanduur. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 18, 2023
@shanduur shanduur marked this pull request as ready for review November 16, 2023 17:30
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 16, 2023
@k8s-ci-robot k8s-ci-robot requested a review from wlan0 November 16, 2023 17:31
Signed-off-by: Mateusz Urbanek <[email protected]>
@shanduur shanduur force-pushed the feat-event-recorder branch from c255857 to e40e69f Compare November 16, 2023 17:34
Signed-off-by: Mateusz Urbanek <[email protected]>
@shanduur shanduur force-pushed the feat-event-recorder branch from 999905d to 8a30877 Compare November 30, 2023 18:48
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 8, 2023
shanduur and others added 2 commits December 8, 2023 20:56
Signed-off-by: Mateusz Urbanek <[email protected]>
Co-authored-by: Blaine Gardner <[email protected]>
Signed-off-by: Mateusz Urbanek <[email protected]>
@shanduur shanduur force-pushed the feat-event-recorder branch from 35b6313 to a54e178 Compare February 13, 2024 20:59
Signed-off-by: Mateusz Urbanek <[email protected]>
Signed-off-by: Mateusz Urbanek <[email protected]>
@shanduur shanduur force-pushed the feat-event-recorder branch 2 times, most recently from 93ac92f to cc5b09d Compare February 22, 2024 14:17
Signed-off-by: Mateusz Urbanek <[email protected]>
@shanduur shanduur force-pushed the feat-event-recorder branch from cc5b09d to 2e33d55 Compare February 22, 2024 14:19
@shanduur shanduur requested a review from BlaineEXE February 22, 2024 15:32
Copy link
Contributor

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

I'm curious why some errors log but don't record events, and there is one error that records an event but doesn't log. Would it be better to wrap the provisionBucketClaimOperation() in a function that automatically handles logging and event recording when there is any error provisioning a bucket?

@@ -153,9 +160,12 @@ func (b *bucketClaimListener) provisionBucketClaimOperation(ctx context.Context,
}

bucketClass, err := b.bucketClasses().Get(ctx, bucketClassName, metav1.GetOptions{})
if err != nil {
if kubeerrors.IsNotFound(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if IsNotFound() handles the nil case. Would it be better for this to be something like below, or am I missing something?

if err != nil {
    if kubeerrors.IsNotFound(err) {
        b.recordEvent( ... )  
    }
    klog.V(3)....
    return err
}

Signed-off-by: Mateusz Urbanek <[email protected]>
@shanduur shanduur requested a review from BlaineEXE March 14, 2024 18:31
@xing-yang
Copy link

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 9, 2024
@BlaineEXE
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BlaineEXE, shanduur

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 May 16, 2024
@BlaineEXE
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 16, 2024
@k8s-ci-robot k8s-ci-robot merged commit 944f7c9 into kubernetes-retired:master May 16, 2024
4 checks passed
@shanduur shanduur deleted the feat-event-recorder branch May 16, 2024 19:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants