Prevent Helm values schema validation to fetch external references when airgap #5029
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.
What this PR does / why we need it:
By default, Helm will validate the values with a JSON schema if present in the chart.
Typically, if a subchart is defined as dependency, the top JSON schema includes references to subchart own JSON schema.
Often, this reference is a URI to download from “the outside”, which breaks Helm use when the environment is air-gapped.
Helm provides an option to disable values schema validation (
SkipSchemaValidation
), which can be use to prevent this to happening in this context.Ideal would to check if the JSON schema (and its dependencies) contains external
$ref
s but there is no easy way to achieve that.In that extent, the proposed addition is fairly simple, even if it might disable JSON schema validation when it would have been possible without an error.
Which issue(s) this PR fixes:
No issue, but here is my investigation.
When running install with a Helm chart:
client.Run()
get called:kots/pkg/base/helm_v3.go
Line 54 in 767739e
client
objectclient.SkipSchemaValidation
,client.Run()
will start schema validation: https://github.com/helm/helm/blob/11a9bf060bcf81475715fd721811f52b28c65872/pkg/action/install.go#L304$ref
: https://www.learnjsonschema.com/2020-12/core/ref/Does this PR require a test?
I don't think so, but please let me know if it would be required.
Does this PR require a release note?
Does this PR require documentation?
I don't think so.
References: