Repository navigation
🐛 Shutdown manager if cert-watcher fails to start - #3625
somtochiama wants to merge 15 commits into
Conversation
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
|
Welcome @somtochiama! |
|
Hi @somtochiama. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: somtochiama The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
|
/ok-to-test |
| @@ -322,6 +332,10 @@ func (s *defaultServer) createListener(ctx context.Context, log logr.Logger) (ne | |||
| go func() { | |||
| if err := certWatcher.Start(ctx); err != nil { | |||
There was a problem hiding this comment.
Today cert watcher only fails if it cannot add watches in l.127 (certwatcher.go).
It does not fail if reading certificates continuously fails in l.142 (certwatcher.go).
I wonder if we should return an error in l.143 if reading certificates failed for a while
@alvaroaleman what do you think?
There was a problem hiding this comment.
I don't know, it doesn't have to mean there is an issue since the already-loaded ones may still be valid? Potentially incorrectly failing seems subpar. Iff we do that, we could maybe check the existing certs NotAfter?
There was a problem hiding this comment.
Iff we do that, we could maybe check the existing certs NotAfter?
Good idea. I think let's look into that
There was a problem hiding this comment.
Added in the last commit, an error is returned on three consecutive failures so temporary read errors don't cause shutdown.
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This pull requests returns an error from the metrics and webhook server
Startmethods when the certificate watcher cannot register its file watches. The manager shuts down instead of serving a certificate that will never be rotated, which would later break TLS for clients.Fixes: #3413