Skip to content

Commit e39df2d

Browse files
committed
script config bug fix
1 parent 81ed4c3 commit e39df2d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎internal/provider/resources/script_config.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/hashicorp/terraform-plugin-framework/path"
1111
"github.com/hashicorp/terraform-plugin-framework/resource"
1212
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
13+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
1314
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1415
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
1516
"github.com/hashicorp/terraform-plugin-framework/types"
@@ -83,6 +84,7 @@ func (r *ScriptConfigResource) Schema(ctx context.Context, req resource.SchemaRe
8384
Description: "Whether the script config should be activated. Defaults to true.",
8485
Optional: true,
8586
Computed: true,
87+
Default: booldefault.StaticBool(true),
8688
},
8789
"purpose": schema.StringAttribute{
8890
Description: "Purpose of the script config definition.",
@@ -262,7 +264,7 @@ func (r *ScriptConfigResource) Update(ctx context.Context, req resource.UpdateRe
262264
}
263265
resp.Diagnostics.AddError(
264266
fmt.Sprintf("Error %sing CacheFly Script Config", action),
265-
fmt.Sprintf("Could not %s script config with ID %s: %s", action, configID, err.Error()),
267+
fmt.Sprintf("Could not %se script config with ID %s: %s", action, configID, err.Error()),
266268
)
267269
return
268270
}
@@ -313,7 +315,7 @@ func (r *ScriptConfigResource) mapScriptConfigToState(config *api.ScriptConfig,
313315
data.UseSchema = types.BoolValue(config.UseSchema)
314316
data.DataModel = types.StringValue(config.DataModel)
315317

316-
if config.Status == "ACTIVATED" {
318+
if config.Status == "ACTIVE" {
317319
data.Activated = types.BoolValue(true)
318320
} else {
319321
data.Activated = types.BoolValue(false)

0 commit comments

Comments
 (0)