Skip to content
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 disableSchemaValidation to Helm install/upgrade actions #1068

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api/v2/helmrelease_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,11 @@ type Install struct {
// +optional
DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"`

// DisableSchemaValidation prevents the Helm install action from validating
// the values against the JSON Schema.
// +optional
DisableSchemaValidation bool `json:"disableSchemaValidation,omitempty"`

// Replace tells the Helm install action to re-use the 'ReleaseName', but only
// if that name is a deleted release which remains in the history.
// +optional
Expand Down Expand Up @@ -624,6 +629,11 @@ type Upgrade struct {
// +optional
DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"`

// DisableSchemaValidation prevents the Helm upgrade action from validating
// the values against the JSON Schema.
// +optional
DisableSchemaValidation bool `json:"disableSchemaValidation,omitempty"`

// Force forces resource updates through a replacement strategy.
// +optional
Force bool `json:"force,omitempty"`
Expand Down
10 changes: 10 additions & 0 deletions config/crd/bases/helm.toolkit.fluxcd.io_helmreleases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ spec:
DisableOpenAPIValidation prevents the Helm install action from validating
rendered templates against the Kubernetes OpenAPI Schema.
type: boolean
disableSchemaValidation:
description: |-
DisableSchemaValidation prevents the Helm install action from validating
the values against the JSON Schema.
type: boolean
disableWait:
description: |-
DisableWait disables the waiting for resources to be ready after a Helm
Expand Down Expand Up @@ -774,6 +779,11 @@ spec:
DisableOpenAPIValidation prevents the Helm upgrade action from validating
rendered templates against the Kubernetes OpenAPI Schema.
type: boolean
disableSchemaValidation:
description: |-
DisableSchemaValidation prevents the Helm upgrade action from validating
the values against the JSON Schema.
type: boolean
disableWait:
description: |-
DisableWait disables the waiting for resources to be ready after a Helm
Expand Down
26 changes: 26 additions & 0 deletions docs/api/v2/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,19 @@ rendered templates against the Kubernetes OpenAPI Schema.</p>
</tr>
<tr>
<td>
<code>disableSchemaValidation</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>DisableSchemaValidation prevents the Helm install action from validating
the values against the JSON Schema.</p>
</td>
</tr>
<tr>
<td>
<code>replace</code><br>
<em>
bool
Expand Down Expand Up @@ -2720,6 +2733,19 @@ rendered templates against the Kubernetes OpenAPI Schema.</p>
</tr>
<tr>
<td>
<code>disableSchemaValidation</code><br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>DisableSchemaValidation prevents the Helm upgrade action from validating
the values against the JSON Schema.</p>
</td>
</tr>
<tr>
<td>
<code>force</code><br>
<em>
bool
Expand Down
4 changes: 4 additions & 0 deletions docs/spec/v2/helmreleases.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ The field offers the following subfields:
from running during the installation of the chart. Defaults to `false`.
- `.disableOpenAPIValidation` (Optional): Prevents Helm from validating the
rendered templates against the Kubernetes OpenAPI Schema. Defaults to `false`.
- `.disableSchemaValidation` (Optional): Prevents Helm from validating the
values against the JSON Schema. Defaults to `false`.
- `.disableWait` (Optional): Disables waiting for resources to be ready after
the installation of the chart. Defaults to `false`.
- `.disableWaitForJobs` (Optional): Disables waiting for any Jobs to complete
Expand Down Expand Up @@ -534,6 +536,8 @@ The field offers the following subfields:
from running during the upgrade of the release. Defaults to `false`.
- `.disableOpenAPIValidation` (Optional): Prevents Helm from validating the
rendered templates against the Kubernetes OpenAPI Schema. Defaults to `false`.
- `.disableSchemaValidation` (Optional): Prevents Helm from validating the
values against the JSON Schema. Defaults to `false`.
- `.disableWait` (Optional): Disables waiting for resources to be ready after
upgrading the release. Defaults to `false`.
- `.disableWaitForJobs` (Optional): Disables waiting for any Jobs to complete
Expand Down
1 change: 1 addition & 0 deletions internal/action/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func newInstall(config *helmaction.Configuration, obj *v2.HelmRelease, opts []In
install.WaitForJobs = !obj.GetInstall().DisableWaitForJobs
install.DisableHooks = obj.GetInstall().DisableHooks
install.DisableOpenAPIValidation = obj.GetInstall().DisableOpenAPIValidation
install.SkipSchemaValidation = obj.GetInstall().DisableSchemaValidation
install.Replace = obj.GetInstall().Replace
install.Devel = true
install.SkipCRDs = true
Expand Down
1 change: 1 addition & 0 deletions internal/action/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func newUpgrade(config *helmaction.Configuration, obj *v2.HelmRelease, opts []Up
upgrade.WaitForJobs = !obj.GetUpgrade().DisableWaitForJobs
upgrade.DisableHooks = obj.GetUpgrade().DisableHooks
upgrade.DisableOpenAPIValidation = obj.GetUpgrade().DisableOpenAPIValidation
upgrade.SkipSchemaValidation = obj.GetUpgrade().DisableSchemaValidation
upgrade.Force = obj.GetUpgrade().Force
upgrade.CleanupOnFail = obj.GetUpgrade().CleanupOnFail
upgrade.Devel = true
Expand Down