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

Validate k0s config before installing into k0s config path #567

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

kke
Copy link
Contributor

@kke kke commented Oct 6, 2023

Fixes #562

Before this PR k0sctl wrote the config directly to /etc/k0s/k0s.yaml (or h.Configurer.K0sConfigPath())

If the configuration was invalid, the broken config would have been left in as the current k0s config and restarting the server would make it fail to wake up again.

This PR first writes the config into a temp file and validates it, if the validation passes, only then it will be used to replace the effective configuration.

@kke kke added the bug Something isn't working label Oct 6, 2023
@kke kke force-pushed the prevalidate-k0s-config branch from f017b58 to 2d6d4d3 Compare October 6, 2023 10:42
Signed-off-by: Kimmo Lehto <[email protected]>
@kke
Copy link
Contributor Author

kke commented Oct 9, 2023

Seems like k0s config validate doesn't display any errors, but the exit status is correct, so this should work.

@kke kke merged commit f6efd26 into main Oct 9, 2023
25 checks passed
@kke kke deleted the prevalidate-k0s-config branch October 9, 2023 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storage extension misconfiguration takes down all controllers
1 participant