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

Omit repetitive events during cluster creation #2652

Merged

Conversation

jayesh-srivastava
Copy link
Member

@jayesh-srivastava jayesh-srivastava commented Sep 14, 2022

What type of PR is this?
/kind feature
/kind cleanup

What this PR does / why we need it: This PR removes unnecessary repetitive events during cluster creation.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2651

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Remove repetitive events during cluster creation 

@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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 14, 2022
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 14, 2022
@jayesh-srivastava
Copy link
Member Author

/test pull-cluster-api-provider-azure-test
/test pull-cluster-api-provider-azure-coverage

@mboersma
Copy link
Contributor

mboersma commented Sep 15, 2022

Thanks @jayesh-srivastava! I'm all for brevity.

How exactly does this show up as repetitive? Do we get multiples of the same event when we provision a cluster, or is this not a useful thing to record in the first place?

Edit: never mind, I read #2651. I guess the question is: is it ok to omit this event entirely, instead of trying to log it just once?

@jayesh-srivastava
Copy link
Member Author

@mboersma It made sense at the moment to remove this entirely but I guess we can have a level 2 logger to have some brevity. What are your thoughts?

@mboersma
Copy link
Contributor

/lgtm

I don't think in general it's necessary to note success cases. We should assume things are working and only log exceptional events, IMHO.

I searched the codebase for where else we use EventRecorder, and I don't see any other cases where we create an event for "successful reconcile." So I think we can just remove these, as you've done.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 20, 2022
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon 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

@CecileRobertMichon
Copy link
Contributor

CecileRobertMichon commented Sep 20, 2022

/hold

@jayesh-srivastava please squash commits and add a release note in the PR description so we can give you credit in the release

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 20, 2022
@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 lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. labels Sep 21, 2022
@jayesh-srivastava
Copy link
Member Author

@jayesh-srivastava please squash commits and add a release note in the PR description so we can give you credit in the release

@CecileRobertMichon Done!

Copy link
Contributor

@mboersma mboersma 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 21, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon, mboersma

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:
  • OWNERS [CecileRobertMichon,mboersma]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mboersma
Copy link
Contributor

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 21, 2022
@k8s-ci-robot k8s-ci-robot merged commit d28ff9a into kubernetes-sigs:main Sep 21, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone Sep 21, 2022
@jackfrancis
Copy link
Contributor

/cherry-pick release-1.4
/cherry-pick release-1.5

@k8s-infra-cherrypick-robot

@jackfrancis: #2652 failed to apply on top of branch "release-1.4":

Applying: Fix repetitive events
Using index info to reconstruct a base tree...
M	exp/controllers/azuremanagedcontrolplane_controller.go
M	exp/controllers/azuremanagedmachinepool_controller.go
Falling back to patching base and 3-way merge...
Auto-merging exp/controllers/azuremanagedmachinepool_controller.go
CONFLICT (content): Merge conflict in exp/controllers/azuremanagedmachinepool_controller.go
Auto-merging exp/controllers/azuremanagedcontrolplane_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix repetitive events
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.4
/cherry-pick release-1.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.

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/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix repetitive cluster events
6 participants