Skip to content

Commit 07a0525

Browse files
committed
Fix
1 parent cb6009a commit 07a0525

File tree

2 files changed

+1149
-22218
lines changed

2 files changed

+1149
-22218
lines changed

internal/services/k8s/pool.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality"
1515
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional"
1616
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/zonal"
17+
"github.com/scaleway/terraform-provider-scaleway/v2/internal/meta"
1718
"github.com/scaleway/terraform-provider-scaleway/v2/internal/services/ipam"
1819
"github.com/scaleway/terraform-provider-scaleway/v2/internal/types"
1920
"github.com/scaleway/terraform-provider-scaleway/v2/internal/verify"
@@ -281,7 +282,6 @@ func ResourceK8SPoolCreate(ctx context.Context, d *schema.ResourceData, m any) d
281282
Autohealing: d.Get("autohealing").(bool),
282283
Size: uint32(d.Get("size").(int)),
283284
Tags: types.ExpandStrings(d.Get("tags")),
284-
Zone: scw.Zone(d.Get("zone").(string)),
285285
KubeletArgs: expandKubeletArgs(d.Get("kubelet_args")),
286286
PublicIPDisabled: d.Get("public_ip_disabled").(bool),
287287
}
@@ -290,8 +290,9 @@ func ResourceK8SPoolCreate(ctx context.Context, d *schema.ResourceData, m any) d
290290
req.Region = scw.Region(v.(string))
291291
}
292292

293-
if v, ok := d.GetOk("zone"); ok {
294-
req.Zone = scw.Zone(v.(string))
293+
zone, err := meta.ExtractZone(d, m)
294+
if zone != "" {
295+
req.Zone = zone
295296
}
296297

297298
if placementGroupID, ok := d.GetOk("placement_group_id"); ok {

0 commit comments

Comments
 (0)