-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Validate the configuration as part of a pre-flight check #13168
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
Merged
Merged
Conversation
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
2a8e95e
to
d2dc67d
Compare
d2dc67d
to
946c0d6
Compare
/hold |
Pothulapati
approved these changes
Sep 22, 2022
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.
Code looks good, and it works well as expected!
Tried setting observability.logLevel
to a random value
this may overwrite all settings: observability:\n logLevel: random\n"
time="2022-09-22T08:35:52Z" level=info msg="File written to /tmp/gitpod-config.yaml"
Gitpod: Validate config
{
"valid": false,
"fatal": [
"Field 'Config.Observability.LogLevel' failed log_level validation"
]
}
Error: configuration invalid
Usage:
And, Fixing it made the tests pass!
Really excited for all the useful validation checks to show up in kots
now! 🚀
946c0d6
to
ac0e0d7
Compare
/unhold |
This was referenced Sep 26, 2022
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
Enable validation of the configuration in KOTS in a preflight check.
This also pushes the result of the installation script to a configmap for users to easily read the logs. The reason for the "push to configmap" is because we cannot output dynamic data in an error message (or, at least, there's no documented example from Replicated). This has been noted on the "limitations of Replicated" page as one of the things to solve in the future.
This also removes the serviceaccount/clusterrolebinding that we define in favour of the KOTS RBAC configuration - this was not available when we first did it. We need this change because we need a serviceaccount BEFORE the application is deployed.
Limitations
This tests every piece of data that is not stored in a secret. Currently, that is just the merging of the custom image pull secrets. Because the preflight checks are run BEFORE anything is deployed, we cannot deploy secrets until AFTER they're deployed - there is a ticket open with Replicated that would solve this limitation, although there has been little traction on this as yet.
Theoretically, we could store the config values in plain text in the config map, but this would make them visible in the KOTS dashboard so I have elected to not do this. I'm happy to have discussions on this however.
The refactoring work has reduced this gap from pretty-much everything to a very specific limitation.
Related Issue(s)
Fixes #12015
How to test
kubectl get configmaps -n gitpod gitpod-installation-status -o jsonpath="{.data.gitpod-installer\.log}"
) and check the logs are "correct" as per your testAdding a config patch as the following is a good way of enforcing a failure
Release Notes
Documentation
Werft options:
Valid options are
all
,workspace
,webapp
,ide