Skip to content

Commit de5eea4

Browse files
committed
update go.mod
1 parent a774dcf commit de5eea4

File tree

5 files changed

+18
-38
lines changed

5 files changed

+18
-38
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
github.com/nats-io/jwt/v2 v2.7.4
2929
github.com/nats-io/nats.go v1.38.0
3030
github.com/robfig/cron/v3 v3.0.1
31-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250610132304-0ea56270b666
31+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613151004-c065a4eb7430
3232
github.com/stretchr/testify v1.10.0
3333
golang.org/x/crypto v0.38.0
3434
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
@@ -447,8 +447,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
447447
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
448448
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
449449
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
450-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250610132304-0ea56270b666 h1:NYaPksM7wPC69Fe9VCUoYY8GYB1hplR6s5hO2PA9rSQ=
451-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250610132304-0ea56270b666/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g=
450+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613151004-c065a4eb7430 h1:npqerdt+HbDkv1+43FdhXNKnzKqkxfwgCCZDHgZRKNE=
451+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250613151004-c065a4eb7430/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g=
452452
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
453453
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
454454
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=

internal/services/file/filesystem_test.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,6 @@ func TestAccFileSystem_SizeTooSmallFails(t *testing.T) {
8181
})
8282
}
8383

84-
func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
85-
tt := acctest.NewTestTools(t)
86-
defer tt.Cleanup()
87-
88-
fileSystemName := "TestAccFileSystem_InvalidSizeGranularityFails"
89-
size := int64(25_000_000_000)
90-
91-
resource.ParallelTest(t, resource.TestCase{
92-
PreCheck: func() { acctest.PreCheck(t) },
93-
ProviderFactories: tt.ProviderFactories,
94-
CheckDestroy: filetestfuncs.CheckFileDestroy(tt),
95-
Steps: []resource.TestStep{
96-
{
97-
Config: fmt.Sprintf(`
98-
resource "scaleway_file_filesystem" "fs" {
99-
name = "%s"
100-
size = %d
101-
}
102-
`, fileSystemName, size),
103-
ExpectError: regexp.MustCompile("size must be greater or equal to 100000000000"),
104-
},
105-
},
106-
})
107-
}
108-
10984
func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
11085
tt := acctest.NewTestTools(t)
11186
defer tt.Cleanup()

internal/services/instance/server.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -539,17 +539,16 @@ func ResourceInstanceServerCreate(ctx context.Context, d *schema.ResourceData, m
539539
///
540540
// Attach Filesystem
541541
///
542-
_, err = waitForServer(ctx, api.API, zone, res.Server.ID, d.Timeout(schema.TimeoutCreate))
542+
543543
if filesystems, ok := d.GetOk("filesystems"); ok {
544-
for _, filesystem := range filesystems.([]interface{}) {
545-
fs := filesystem.(map[string]interface{})
544+
for _, filesystem := range filesystems.([]any) {
545+
fs := filesystem.(map[string]any)
546546
filesystemID := fs["filesystem_id"]
547547
_, err := api.AttachServerFileSystem(&instanceSDK.AttachServerFileSystemRequest{
548548
Zone: zone,
549549
FilesystemID: regional.ExpandID(filesystemID.(string)).ID,
550550
ServerID: res.Server.ID,
551551
})
552-
553552
if err != nil {
554553
return nil
555554
}
@@ -1120,8 +1119,8 @@ func ResourceInstanceServerUpdate(ctx context.Context, d *schema.ResourceData, m
11201119
if d.HasChange("filesystems") {
11211120
oldRaw, newRaw := d.GetChange("filesystems")
11221121

1123-
oldList := oldRaw.([]interface{})
1124-
newList := newRaw.([]interface{})
1122+
oldList := oldRaw.([]any)
1123+
newList := newRaw.([]any)
11251124

11261125
oldIDs := make(map[string]struct{})
11271126
newIDs := make(map[string]struct{})
@@ -1252,6 +1251,7 @@ func attachNewFileSystem(newIDs map[string]struct{}, oldIDs map[string]struct{},
12521251
}
12531252
}
12541253
}
1254+
12551255
return nil, false
12561256
}
12571257

@@ -1268,12 +1268,13 @@ func detachOlDFileSystem(oldIDs map[string]struct{}, newIDs map[string]struct{},
12681268
}
12691269
}
12701270
}
1271+
12711272
return nil, false
12721273
}
12731274

1274-
func collectFilesystemIDs(fsList []interface{}, target map[string]struct{}) {
1275+
func collectFilesystemIDs(fsList []any, target map[string]struct{}) {
12751276
for _, fs := range fsList {
1276-
if fsMap, ok := fs.(map[string]interface{}); ok {
1277+
if fsMap, ok := fs.(map[string]any); ok {
12771278
id := fsMap["filesystem_id"].(string)
12781279
target[id] = struct{}{}
12791280
}
@@ -1319,14 +1320,17 @@ func ResourceInstanceServerDelete(ctx context.Context, d *schema.ResourceData, m
13191320

13201321
// Detach filesystem
13211322
if filesystems, ok := d.GetOk("filesystems"); ok {
1322-
fsList := filesystems.([]interface{})
1323+
fsList := filesystems.([]any)
13231324
for i, fsRaw := range fsList {
1324-
fsMap := fsRaw.(map[string]interface{})
1325+
fsMap := fsRaw.(map[string]any)
1326+
13251327
fsIDRaw, ok := fsMap["filesystem_id"]
13261328
if !ok || fsIDRaw == nil {
13271329
return diag.Errorf("filesystem_id is missing or nil for filesystem at index %d", i)
13281330
}
1331+
13291332
fsID := fsIDRaw.(string)
1333+
13301334
newFileSystemID := types.ExpandStringPtr(fsID)
13311335
if newFileSystemID == nil {
13321336
return diag.Errorf("failed to expand filesystem_id pointer at index %d", i)

internal/services/instance/waiters.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func waitForFilesystems(ctx context.Context, api *instance.API, zone scw.Zone, i
9797
if transport.DefaultWaitRetryInterval != nil {
9898
retryInterval = *transport.DefaultWaitRetryInterval
9999
}
100+
100101
server, err := api.WaitForServerFileSystem(&instance.WaitForServerFileSystemRequest{
101102
ServerID: id,
102103
Zone: zone,

0 commit comments

Comments
 (0)