diff --git a/src/api/v1alpha1/component.go b/src/api/v1alpha1/component.go index 74ac45251c..8948f03f5c 100644 --- a/src/api/v1alpha1/component.go +++ b/src/api/v1alpha1/component.go @@ -157,6 +157,16 @@ type ZarfChart struct { ValuesFiles []string `json:"valuesFiles,omitempty"` // [alpha] List of variables to set in the Helm chart. Variables []ZarfChartVariable `json:"variables,omitempty"` + // Whether or not to validate the values.yaml schema, defaults to true. Necessary in the air-gap when the JSON Schema references resources on the internet. + SchemaValidation *bool `json:"schemaValidation,omitempty"` +} + +// ShouldRunSchemaValidation returns if Helm schema validation should be run or not +func (zc ZarfChart) ShouldRunSchemaValidation() bool { + if zc.SchemaValidation != nil { + return *zc.SchemaValidation + } + return true } // ZarfChartVariable represents a variable that can be set for a Helm chart overrides. diff --git a/src/internal/packager/helm/chart.go b/src/internal/packager/helm/chart.go index 954b1d6144..68914d3d51 100644 --- a/src/internal/packager/helm/chart.go +++ b/src/internal/packager/helm/chart.go @@ -294,6 +294,8 @@ func (h *Helm) installChart(ctx context.Context, postRender *renderer) (*release // Must be unique per-namespace and < 53 characters. @todo: restrict helm loadedChart name to this. client.ReleaseName = h.chart.ReleaseName + client.SkipSchemaValidation = !h.chart.ShouldRunSchemaValidation() + // Namespace must be specified. client.Namespace = h.chart.Namespace @@ -327,6 +329,8 @@ func (h *Helm) upgradeChart(ctx context.Context, lastRelease *release.Release, p client.SkipCRDs = true + client.SkipSchemaValidation = !h.chart.ShouldRunSchemaValidation() + // Namespace must be specified. client.Namespace = h.chart.Namespace diff --git a/zarf.schema.json b/zarf.schema.json index 67094c0f38..9b474b9400 100644 --- a/zarf.schema.json +++ b/zarf.schema.json @@ -377,6 +377,10 @@ }, "type": "array", "description": "[alpha] List of variables to set in the Helm chart." + }, + "schemaValidation": { + "type": "boolean", + "description": "Whether or not to validate the values.yaml schema, defaults to true. Necessary in the air-gap when the JSON Schema references resources on the internet." } }, "additionalProperties": false,