-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Use local definitions for k8s schema validation #20544
Conversation
Instead of using remote schemas to validate helm chart values, we will vendor in the definitions locally so the chart can be used without using outbound connections. There is a precommit hook that will ensure only the definitions we use are included in our schema file, as there are quite a few of them all together otherwise.
I'm not sure if it is worth the effort to only include the upstream defs we actually use, but it does cut it down from 17.5k lines to 2.6k, so figured it was worth exploring at least. Thoughts? |
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.
Smart!
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
Makes perfect sense - especially that it's fully automated with pre-commit. Eventually we might want to contribute (thought about it) support to add mapped loaders for refs and then we could even bundle all the definitions as separate files - https://github.com/xeipuuv/gojsonschema#loading-local-schemas - but that would have to be approved by helm maintainers and released. |
The only problem with this is a way how to use some definitions that we do not use currently. I think it is worth to do it in the way that we can also remove the vendoing easily (reversing the process). The process would loook like this;
|
Yeah, I think an easier way would be to simply remove all |
Cool! |
Instead of using remote schemas to validate helm chart values, we will
vendor in the definitions locally so the chart can be used without
using outbound connections.
There is a precommit hook that will ensure only the definitions we use
are included in our schema file, as there are quite a few of them all
together otherwise.
closes: #20539