Skip to content

Commit 3f03847

Browse files
authored
chore: bump sdk-go (#2778)
* chore: bump sdk-go Instance API did a breaking change in generated SDK * go mod tidy
1 parent 3617200 commit 3f03847

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/nats-io/jwt/v2 v2.7.0
2424
github.com/nats-io/nats.go v1.37.0
2525
github.com/robfig/cron/v3 v3.0.1
26-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241016121547-71e46305b9a0
26+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241018083319-8ca184d21821
2727
github.com/stretchr/testify v1.9.0
2828
golang.org/x/crypto v0.27.0
2929
gopkg.in/dnaeon/go-vcr.v3 v3.2.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXq
242242
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
243243
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
244244
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
245-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241016121547-71e46305b9a0 h1:bykODWS911XOzQZ+WfJ2NmWmFcB0Iuod5+brNIUeNqE=
246-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241016121547-71e46305b9a0/go.mod h1:3jrRJM7638J+P33hKy9MBvfOBxNo8pEGNQQoIv65Ihg=
245+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241018083319-8ca184d21821 h1:lUig6xEMWR3vL7jAw0rX8XfCVyrcE11lOfh85TR4jgU=
246+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241018083319-8ca184d21821/go.mod h1:3jrRJM7638J+P33hKy9MBvfOBxNo8pEGNQQoIv65Ihg=
247247
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
248248
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
249249
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=

internal/services/instance/server.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,14 +410,17 @@ func ResourceInstanceServerCreate(ctx context.Context, d *schema.ResourceData, m
410410
Zone: zone,
411411
Name: types.ExpandOrGenerateString(d.Get("name"), "srv"),
412412
Project: types.ExpandStringPtr(d.Get("project_id")),
413-
Image: imageUUID,
414413
CommercialType: commercialType,
415414
SecurityGroup: types.ExpandStringPtr(zonal.ExpandID(d.Get("security_group_id")).ID),
416415
DynamicIPRequired: scw.BoolPtr(d.Get("enable_dynamic_ip").(bool)),
417416
Tags: types.ExpandStrings(d.Get("tags")),
418417
RoutedIPEnabled: types.ExpandBoolPtr(types.GetBool(d, "routed_ip_enabled")),
419418
}
420419

420+
if imageUUID != "" {
421+
req.Image = scw.StringPtr(imageUUID)
422+
}
423+
421424
enableIPv6, ok := d.GetOk("enable_ipv6")
422425
if ok {
423426
req.EnableIPv6 = scw.BoolPtr(enableIPv6.(bool)) //nolint:staticcheck
@@ -453,7 +456,7 @@ func ResourceInstanceServerCreate(ctx context.Context, d *schema.ResourceData, m
453456
req.Volumes = make(map[string]*instanceSDK.VolumeServerTemplate)
454457
rootVolume := d.Get("root_volume.0").(map[string]any)
455458

456-
req.Volumes["0"] = prepareRootVolume(rootVolume, serverType, req.Image).VolumeTemplate()
459+
req.Volumes["0"] = prepareRootVolume(rootVolume, serverType, imageUUID).VolumeTemplate()
457460
if raw, ok := d.GetOk("additional_volume_ids"); ok {
458461
for i, volumeID := range raw.([]interface{}) {
459462
// We have to get the volume to know whether it is a local or a block volume

0 commit comments

Comments
 (0)