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

podinfo: Handle an expected error gracefully #1777

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

michi-covalent
Copy link
Contributor

@michi-covalent michi-covalent commented Nov 20, 2023

Sometimes creating a podinfo fails with AlreadyExists error even though the previous call to get the podinfo returned NotFound because of a timing issue. Requeue without returning the error when this happens to prevent the controller from logging an unnecessary error.

operator: Don't log an error if the PodInfo resource already exists.

Sometimes creating a podinfo fails with AlreadyExists error even though
the previous call to get the podinfo returned NotFound because of a
timing issue. Requeue without returning the error when this happens to
prevent the controller from logging an unnecessary error.

Signed-off-by: Michi Mutsuzaki <[email protected]>
@michi-covalent michi-covalent requested a review from a team as a code owner November 20, 2023 22:45
@michi-covalent michi-covalent added the release-note/misc This PR makes changes that have no direct user impact. label Nov 20, 2023
Copy link
Member

@sayboras sayboras left a comment

Choose a reason for hiding this comment

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

Small comment as per below.

// previous call to Get returned "NotFound" because of a timing issue.
// Requeue without returning the error when this happens, otherwise
// the controller logs an error.
return ctrl.Result{Requeue: true}, nil
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to requeue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah so the idea is to requeue so that the reconciler exercises the update path the next time around, just to make sure the podinfo has all the up-to-date information.

Copy link
Member

Choose a reason for hiding this comment

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

sounds good ✔️

@michi-covalent michi-covalent merged commit e2b685e into main Nov 21, 2023
29 of 30 checks passed
@michi-covalent michi-covalent deleted the pr/michi/reconcile-struggle branch November 21, 2023 02:04
@lambdanis lambdanis added release-note/minor This PR introduces a minor user-visible change and removed release-note/misc This PR makes changes that have no direct user impact. labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/minor This PR introduces a minor user-visible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants