Skip to content

Refuse to start with expired CA or user-provided certificates - #8886

Draft
cvas22 wants to merge 1 commit into
k0sproject:mainfrom
cvas22:fix/8764-expired-cert-startup-check
Draft

cvas22 wants to merge 1 commit into
k0sproject:mainfrom
cvas22:fix/8764-expired-cert-startup-check

Conversation

@cvas22

@cvas22 cvas22 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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. Only NotAfter is 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?

  • Manual test
  • Automated test added

Added a table-driven test in pkg/certificate with an expired and a valid CA, and an expired and a valid user-provided cert. I ran go test ./pkg/certificate in a Go container, it passes. No manual test on a real cluster.

Checklist

  • This pull request follows the contributing guidelines
  • I have performed a self-review of my changes
  • I have made corresponding changes to the documentation

Notes

Runtime handling is left for a follow-up. I didn't add docs since this only adds an error on startup.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant