-
Notifications
You must be signed in to change notification settings - Fork 42
Fixed cert update race condition #342
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
base: master
Are you sure you want to change the base?
Fixed cert update race condition #342
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #342 +/- ##
==========================================
+ Coverage 57.16% 58.87% +1.70%
==========================================
Files 1 1
Lines 572 586 +14
==========================================
+ Hits 327 345 +18
+ Misses 181 178 -3
+ Partials 64 63 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d7b4e7b
to
f433eba
Compare
pkg/rotator/rotator.go
Outdated
// Continue with reconciliation | ||
case <-r.certsNotMounted: | ||
// Requeue with backoff strategy | ||
return reconcile.Result{Requeue: true, RequeueAfter: 5 * time.Second}, errors.New("certs not mounted, retrying reconciliation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the <-r.certsNotMounted
case I would return reconcile.Result{}, errors.New("certs not mounted, retrying reconciliation")
. For completeness I would also check ctx.Done
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the check for ctx.Done
.
Signed-off-by: Patryk Strusiewicz-Surmacki <patryk-pawel.strusiewicz-surmacki@external.telekom.de>
Co-authored-by: Rita Zhang <rita.z.zhang@gmail.com> Signed-off-by: Patryk Strusiewicz-Surmacki <137421299+p-strusiewiczsurmacki-mobica@users.noreply.github.com>
Signed-off-by: Patryk Strusiewicz-Surmacki <patryk-pawel.strusiewicz-surmacki@external.telekom.de>
Signed-off-by: Patryk Strusiewicz-Surmacki <patryk-pawel.strusiewicz-surmacki@external.telekom.de>
Signed-off-by: Patryk Strusiewicz-Surmacki <patryk-pawel.strusiewicz-surmacki@external.telekom.de>
4081a8a
to
17a8458
Compare
This PR should fix #341
It adds check for
certsMounted
channel in reconciliation loop, so reconciliation will only start if all the certs are ready and mounted. This suppresses the irrelevant errors emitted by controller-runtime due to reconciliation loop and runable accessing same secret concurrently.