Skip to content

Commit 326c8de

Browse files
authored
feat(baremetal): add configurable timeout (#1164)
1 parent 9a785a6 commit 326c8de

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scaleway/resource_baremetal_server.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func resourceScalewayBaremetalServerCreate(ctx context.Context, d *schema.Resour
155155
_, err = baremetalAPI.WaitForServer(&baremetal.WaitForServerRequest{
156156
Zone: server.Zone,
157157
ServerID: server.ID,
158-
Timeout: scw.TimeDurationPtr(baremetalServerWaitForTimeout),
158+
Timeout: scw.TimeDurationPtr(d.Timeout(schema.TimeoutCreate)),
159159
RetryInterval: DefaultWaitRetryInterval,
160160
})
161161
if err != nil {
@@ -176,7 +176,7 @@ func resourceScalewayBaremetalServerCreate(ctx context.Context, d *schema.Resour
176176
_, err = baremetalAPI.WaitForServerInstall(&baremetal.WaitForServerInstallRequest{
177177
Zone: server.Zone,
178178
ServerID: server.ID,
179-
Timeout: scw.TimeDurationPtr(baremetalServerWaitForTimeout),
179+
Timeout: scw.TimeDurationPtr(d.Timeout(schema.TimeoutCreate)),
180180
RetryInterval: DefaultWaitRetryInterval,
181181
})
182182
if err != nil {
@@ -263,7 +263,7 @@ func resourceScalewayBaremetalServerUpdate(ctx context.Context, d *schema.Resour
263263
_, err = baremetalAPI.WaitForServerInstall(&baremetal.WaitForServerInstallRequest{
264264
Zone: server.Zone,
265265
ServerID: server.ID,
266-
Timeout: scw.TimeDurationPtr(baremetalServerWaitForTimeout),
266+
Timeout: scw.TimeDurationPtr(d.Timeout(schema.TimeoutUpdate)),
267267
RetryInterval: DefaultWaitRetryInterval,
268268
})
269269
if err != nil {
@@ -295,7 +295,7 @@ func resourceScalewayBaremetalServerDelete(ctx context.Context, d *schema.Resour
295295
_, err = baremetalAPI.WaitForServer(&baremetal.WaitForServerRequest{
296296
Zone: server.Zone,
297297
ServerID: server.ID,
298-
Timeout: scw.TimeDurationPtr(baremetalServerWaitForTimeout),
298+
Timeout: scw.TimeDurationPtr(d.Timeout(schema.TimeoutDelete)),
299299
RetryInterval: DefaultWaitRetryInterval,
300300
})
301301

0 commit comments

Comments
 (0)