Skip to content

Commit

Permalink
Merge pull request #1068 from fluxcd/disable-schema-validation
Browse files Browse the repository at this point in the history
Add `disableSchemaValidation` to Helm install/upgrade actions
  • Loading branch information
stefanprodan authored Sep 24, 2024
2 parents a7c83f6 + 54f0b42 commit 754c2ba
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
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

0 comments on commit 754c2ba

Please sign in to comment.