Skip to content

Commit 79945d5

Browse files
authored
fix(ske): invalid result for dns.zones after creation (#1263)
STACKITTPR-530 Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 44a0f18 commit 79945d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stackit/internal/services/ske/cluster/resource.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"github.com/hashicorp/terraform-plugin-framework/resource/schema"
2222
"github.com/hashicorp/terraform-plugin-framework/resource/schema/booldefault"
2323
"github.com/hashicorp/terraform-plugin-framework/resource/schema/int64default"
24+
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listdefault"
2425
"github.com/hashicorp/terraform-plugin-framework/resource/schema/listplanmodifier"
2526
"github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
2627
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
@@ -661,6 +662,11 @@ func (r *clusterResource) Schema(_ context.Context, _ resource.SchemaRequest, re
661662
Validators: []validator.List{
662663
listvalidator.ValueStringsAre(validate.NoUUID()),
663664
},
665+
// By setting a Default value of an empty list, we tell Terraform to treat a missing
666+
// zones block in the dns as if the user explicitly defined
667+
// zones = []. This ensures the config (empty list) matches the
668+
// API response (empty list).
669+
Default: listdefault.StaticValue(types.ListValueMust(types.StringType, []attr.Value{})),
664670
},
665671
},
666672
},

0 commit comments

Comments
 (0)