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

Chore(internal): Refactor const usage and unready info message #1810

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

Baarsgaard
Copy link
Contributor

@Baarsgaard Baarsgaard commented Jan 4, 2025

Cleaned up some const declarations used across different controllers but scattered around.

@Baarsgaard Baarsgaard force-pushed the refactor_const_usage branch 3 times, most recently from 4620005 to 7987cc0 Compare January 8, 2025 19:52
@Baarsgaard Baarsgaard marked this pull request as ready for review January 9, 2025 16:26
Copy link
Member

@theSuess theSuess left a comment

Choose a reason for hiding this comment

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

Since you're already touching all the return paths, can you adapt this to remove the requeueAfter in the error case? It is ignored and causes an ugly error log message:

2025-01-10T11:58:47.418+0100    info    Warning: Reconciler returned both a non-zero result and a non-nil error. The result will always be ignored if the error is non-nil and the non-nil error causes reqeueuing with exponential backoff. For more details, see: https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/reconcile#Reconciler

@Baarsgaard
Copy link
Contributor Author

Baarsgaard commented Jan 10, 2025

I was planning to refactor one reconcile function per PR as you can see in:
#1807 #1814 #1815
Where I fix the warnings as well as twice logged errors.
But if you prefer, I can do just the warnings here @theSuess?
This did not change any behaviour which is why I opted to keep it separate.

@Baarsgaard Baarsgaard requested a review from theSuess January 10, 2025 13:44
@Baarsgaard Baarsgaard force-pushed the refactor_const_usage branch from 7987cc0 to d979cf5 Compare January 10, 2025 17:29
@Baarsgaard
Copy link
Contributor Author

Baarsgaard commented Jan 10, 2025

Update: I decided to follow through with my plan as this meant I would reduce merge conflicts among my PRs as well.
This means I changed RequeueDelay back to being capitalised and public for now.

@theSuess theSuess added this pull request to the merge queue Jan 13, 2025
Merged via the queue into grafana:master with commit 9a7ea65 Jan 13, 2025
14 checks passed
@Baarsgaard Baarsgaard deleted the refactor_const_usage branch January 13, 2025 18:29
@theSuess theSuess added the refactor this PR refactors code without introducing functionality label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor this PR refactors code without introducing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants