Skip to content

Commit 531dad1

Browse files
authored
fix(serverless): time duration type conversion (#1477)
1 parent 8b794f7 commit 531dad1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

scaleway/resource_container.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ func resourceScalewayContainerUpdate(ctx context.Context, d *schema.ResourceData
305305
}
306306

307307
if d.HasChanges("timeout") {
308-
timeout := d.Get("timeout")
309-
req.Timeout = &scw.Duration{Seconds: timeout.(int64)}
308+
req.Timeout = &scw.Duration{Seconds: int64(d.Get("timeout").(int))}
310309
}
311310

312311
if d.HasChanges("privacy") {

scaleway/resource_function.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func resourceScalewayFunctionCreate(ctx context.Context, d *schema.ResourceData,
163163
}
164164

165165
if timeout, ok := d.GetOk("timeout"); ok {
166-
req.Timeout = &scw.Duration{Seconds: timeout.(int64)}
166+
req.Timeout = &scw.Duration{Seconds: int64(timeout.(int))}
167167
}
168168

169169
f, err := api.CreateFunction(req, scw.WithContext(ctx))
@@ -324,7 +324,7 @@ func resourceScalewayFunctionUpdate(ctx context.Context, d *schema.ResourceData,
324324
}
325325

326326
if d.HasChange("timeout") {
327-
req.Timeout = &scw.Duration{Seconds: d.Get("timeout").(int64)}
327+
req.Timeout = &scw.Duration{Seconds: int64(d.Get("timeout").(int))}
328328
updated = true
329329
}
330330

0 commit comments

Comments
 (0)