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

Controller: Include the object being reconciled in the error_policy #995

Merged
merged 2 commits into from Sep 1, 2022
Merged

Controller: Include the object being reconciled in the error_policy #995

merged 2 commits into from Sep 1, 2022

Conversation

felipesere
Copy link
Contributor

Motivation

Error handling becomes more meaningful if we also have access to the object being reconciled.
That way we can extract its name or other relevant information for metrics or logging purposes.

Solution

Thread the Arc<K> object that is being reconciled through to the error policy.

@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2022

Codecov Report

Merging #995 (59916d8) into master (251728e) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##           master     #995      +/-   ##
==========================================
- Coverage   72.60%   72.58%   -0.03%     
==========================================
  Files          64       64              
  Lines        4505     4505              
==========================================
- Hits         3271     3270       -1     
- Misses       1234     1235       +1     
Impacted Files Coverage Δ
kube-runtime/src/controller/mod.rs 37.27% <66.66%> (ø)
kube-runtime/src/wait.rs 69.81% <0.00%> (-1.89%) ⬇️

Signed-off-by: Felipe Sere <github@felipesere.com>
@clux clux added the changelog-change changelog change category for prs label Aug 31, 2022
@clux clux added this to the 0.75.0 milestone Aug 31, 2022
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

Looks very reasonable. Thank you!

@clux clux changed the title Include the object being reconciled in the error policy Controller: Include the object being reconciled in the error_policy Aug 31, 2022
@clux clux merged commit 57d97ce into kube-rs:master Sep 1, 2022
@felipesere felipesere deleted the extend-error-policy branch September 1, 2022 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-change changelog change category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider passing the main object a controller reconciles into the error_policy
3 participants