Skip to content
Open
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
9 changes: 9 additions & 0 deletions helm/data_helm_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ type HelmTemplateModel struct {
Devel types.Bool `tfsdk:"devel"`
DisableOpenAPIValidation types.Bool `tfsdk:"disable_openapi_validation"`
DisableWebhooks types.Bool `tfsdk:"disable_webhooks"`
DisableSchemaValidation types.Bool `tfsdk:"disable_schema_validation"`
ID types.String `tfsdk:"id"`
IncludeCRDs types.Bool `tfsdk:"include_crds"`
IsUpgrade types.Bool `tfsdk:"is_upgrade"`
Expand Down Expand Up @@ -181,6 +182,10 @@ func (d *HelmTemplate) Schema(ctx context.Context, req datasource.SchemaRequest,
Optional: true,
Description: "Prevent hooks from running.",
},
"disable_schema_validation": schema.BoolAttribute{
Optional: true,
Description: "If set, the schema validation is disabled.",
},
"id": schema.StringAttribute{
Computed: true,
},
Expand Down Expand Up @@ -439,6 +444,9 @@ func (d *HelmTemplate) Read(ctx context.Context, req datasource.ReadRequest, res
if state.DisableOpenAPIValidation.IsNull() || state.DisableOpenAPIValidation.IsUnknown() {
state.DisableOpenAPIValidation = types.BoolValue(false)
}
if state.DisableSchemaValidation.IsNull() || state.DisableSchemaValidation.IsUnknown() {
state.DisableSchemaValidation = types.BoolValue(false)
}
if state.Wait.IsNull() || state.Wait.IsUnknown() {
state.Wait = types.BoolValue(false)
}
Expand Down Expand Up @@ -563,6 +571,7 @@ func (d *HelmTemplate) Read(ctx context.Context, req datasource.ReadRequest, res
client.DependencyUpdate = state.DependencyUpdate.ValueBool()
client.DisableHooks = state.DisableWebhooks.ValueBool()
client.DisableOpenAPIValidation = state.DisableOpenAPIValidation.ValueBool()
client.DisableSchemaValidation = state.DisableSchemaValidation.ValueBool()
client.Atomic = state.Atomic.ValueBool()
client.Replace = state.Replace.ValueBool()
client.SkipCRDs = state.SkipCrds.ValueBool()
Expand Down
11 changes: 11 additions & 0 deletions helm/resource_helm_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type HelmReleaseModel struct {
DisableCrdHooks types.Bool `tfsdk:"disable_crd_hooks"`
DisableOpenapiValidation types.Bool `tfsdk:"disable_openapi_validation"`
DisableWebhooks types.Bool `tfsdk:"disable_webhooks"`
DisableSchemaValidation types.Bool `tfsdk:"disable_schema_validation"`
ForceUpdate types.Bool `tfsdk:"force_update"`
ID types.String `tfsdk:"id"`
Keyring types.String `tfsdk:"keyring"`
Expand Down Expand Up @@ -114,6 +115,7 @@ var defaultAttributes = map[string]interface{}{
"dependency_update": false,
"disable_crd_hooks": false,
"disable_openapi_validation": false,
"disable_schema_validation": false,
"disable_webhooks": false,
"force_update": false,
"lint": false,
Expand Down Expand Up @@ -307,6 +309,12 @@ func (r *HelmRelease) Schema(ctx context.Context, req resource.SchemaRequest, re
Default: booldefault.StaticBool(defaultAttributes["disable_openapi_validation"].(bool)),
Description: "If set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema",
},
"disable_schema_validation": schema.BoolAttribute{
Optional: true,
Computed: true,
Default: booldefault.StaticBool(defaultAttributes["disable_schema_validation"].(bool)),
Description: "If set, the installation process will not validate rendered templates against the Kubernetes OpenAPI Schema",
},
"disable_webhooks": schema.BoolAttribute{
Optional: true,
Computed: true,
Expand Down Expand Up @@ -771,6 +779,7 @@ func (r *HelmRelease) Create(ctx context.Context, req resource.CreateRequest, re
client.SkipCRDs = state.SkipCrds.ValueBool()
client.SubNotes = state.RenderSubchartNotes.ValueBool()
client.DisableOpenAPIValidation = state.DisableOpenapiValidation.ValueBool()
client.DisableSchemaValidation = state.DisableSchemaValidation.ValueBool()
client.Replace = state.Replace.ValueBool()
client.Description = state.Description.ValueString()
client.CreateNamespace = state.CreateNamespace.ValueBool()
Expand Down Expand Up @@ -976,6 +985,7 @@ func (r *HelmRelease) Update(ctx context.Context, req resource.UpdateRequest, re
client.SkipCRDs = plan.SkipCrds.ValueBool()
client.SubNotes = plan.RenderSubchartNotes.ValueBool()
client.DisableOpenAPIValidation = plan.DisableOpenapiValidation.ValueBool()
client.DisableSchemaValidation = plan.DisableSchemaValidation.ValueBool()
client.Force = plan.ForceUpdate.ValueBool()
client.ResetValues = plan.ResetValues.ValueBool()
client.ReuseValues = plan.ReuseValues.ValueBool()
Expand Down Expand Up @@ -1815,6 +1825,7 @@ func (r *HelmRelease) ModifyPlan(ctx context.Context, req resource.ModifyPlanReq
install.SkipCRDs = plan.SkipCrds.ValueBool()
install.SubNotes = plan.RenderSubchartNotes.ValueBool()
install.DisableOpenAPIValidation = plan.DisableOpenapiValidation.ValueBool()
install.DisableSchemaValidation = plan.DisableSchemaValidation.ValueBool()
install.Replace = plan.Replace.ValueBool()
install.Description = plan.Description.ValueString()
install.CreateNamespace = plan.CreateNamespace.ValueBool()
Expand Down
1 change: 1 addition & 0 deletions helm/resource_helm_release_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func TestAccResourceRelease_import(t *testing.T) {
resource.TestCheckResourceAttr("helm_release.imported", "dependency_update", "false"),
resource.TestCheckResourceAttr("helm_release.imported", "replace", "false"),
resource.TestCheckResourceAttr("helm_release.imported", "disable_openapi_validation", "false"),
resource.TestCheckResourceAttr("helm_release.imported", "disable_scheme_validation", "false"),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scheme → schema
(I'm just passing by, not a reviewer, and noticed that typo here)

resource.TestCheckResourceAttr("helm_release.imported", "create_namespace", "false"),
),
},
Expand Down