Repository navigation
Conversation
k0s doesn't re-issue existing CAs or certificates that it doesn't manage. If one of those has expired, fail early with an error naming the file and the expiry time, instead of starting up and spamming the logs with TLS errors. See k0sproject#8764 Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
First slice of #8764, as suggested by @twz123: a startup check only. When an existing CA, or a certificate that k0s doesn't manage (e.g. user-provided), has passed its
NotAfter, k0s now refuses to start and the error names the file and the expiry time. OnlyNotAfteris compared. Certificates k0s issues itself are regenerated as before.Runtime handling of certs that expire while k0s is running isn't part of this.
Fixes part of #8764, see #8764.
Type of change
How has this been tested?
Added a table-driven test in
pkg/certificatewith an expired and a valid CA, and an expired and a valid user-provided cert. I rango test ./pkg/certificatein a Go container, it passes. No manual test on a real cluster.Checklist
Notes
Runtime handling is left for a follow-up. I didn't add docs since this only adds an error on startup.