-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Add kubernetes manifest validation #317
Conversation
c121edd
to
5cf38d9
Compare
5cf38d9
to
13de76b
Compare
@uberspot @ramaro @adrianchifor Option 1kapitan:
validate:
- output_path: <corresponding_path_in_kapitan.compile>
type: kubernetes
kind: <kind>
version: <kubectl-version> Option 2I think it is also possible to put validate options under kapitan:
compile:
- output_path: <output_path>
input_paths:
- <input_path>
validate: kubernetes
kind: <kind>
version: <kubectl-version> But option 2 is not so great because it doesn't work well when one jsonnet file compiles to multiple files, or when there are more than one If we are going with Option 1, If there is a better way over both options, feel free to let me know! |
Option 1 does seem more versatile. All compiled/ outputs should be generated by kapitan compile anyway (and non valid files are deleted after compilation). So I'd assume it's safe to just run schema validation on the compiled target directory directly (assuming those outputs are k8s manifests in this case). |
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.
Nice start! 👍
@uberspot # compile done in parallel above
shutil.rmtree(compile_path)
shutil.copytree(temp_path, compile_path)
logger.debug("Copied %s into %s", temp_path, compile_path) |
How about we detach validation from compile by default? I'm worried compilation will become too slow. I propose we add a new I believe this will make it more versatile - but just a thought! |
@uberspot, @ramaro
|
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.
Nice work! :)
Small reminder to also add a paragraph in the README explaining this new validation functionality and update the new command line args so that everything is self-contained in the MR as well.
@uberspot |
d2ced60
to
241e901
Compare
241e901
to
0cd7677
Compare
0cd7677
to
fb11c03
Compare
c8c12b8
to
4e34479
Compare
(Partly) fixes issue #194
Proposed Changes
https://kubernetesjsonschema.dev
validator
class. E.g. we might at the same time tackle Support to validate the inventory before compiling #258