Skip to content

Commit d6cb2d6

Browse files
authored
fix(container): set region to optional (#2087)
* fix(container): set region to optional * remove useless check in resource_container_cron
1 parent 6d050c4 commit d6cb2d6

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

scaleway/resource_container.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func resourceScalewayContainer() *schema.Resource {
184184
Computed: true,
185185
Description: "The error description",
186186
},
187-
"region": regionComputedSchema(),
187+
"region": regionSchema(),
188188
},
189189
}
190190
}
@@ -195,9 +195,6 @@ func resourceScalewayContainerCreate(ctx context.Context, d *schema.ResourceData
195195
return diag.FromErr(err)
196196
}
197197

198-
if region.String() == "" {
199-
region = scw.RegionFrPar
200-
}
201198
namespaceID := expandID(d.Get("namespace_id").(string))
202199
// verify name space state
203200
_, err = waitForContainerNamespace(ctx, api, region, namespaceID, d.Timeout(schema.TimeoutCreate))

scaleway/resource_container_cron.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func resourceScalewayContainerCron() *schema.Resource {
5151
Computed: true,
5252
Description: "Cron job status.",
5353
},
54-
"region": regionComputedSchema(),
54+
"region": regionSchema(),
5555
},
5656
}
5757
}
@@ -62,10 +62,6 @@ func resourceScalewayContainerCronCreate(ctx context.Context, d *schema.Resource
6262
return diag.FromErr(err)
6363
}
6464

65-
if region.String() == "" {
66-
region = scw.RegionFrPar
67-
}
68-
6965
jsonObj, err := scw.DecodeJSONObject(d.Get("args").(string), scw.NoEscape)
7066
if err != nil {
7167
return diag.FromErr(err)

0 commit comments

Comments
 (0)