Skip to content

Commit 0fbe761

Browse files
committed
update go.mod
1 parent a774dcf commit 0fbe761

File tree

7 files changed

+25
-44
lines changed

7 files changed

+25
-44
lines changed

docs/resources/instance_server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ attached to the server. Updates to this field will trigger a stop/start of the s
255255
~> **Important:** If this field contains local volumes, you have to first detach them, in one apply, and then delete the volume in another apply.
256256

257257
- `filesystem` - (Optional) List of filesystems attached to the server.
258-
- `filesystem_id` - (Optional) The unique ID of the filesystem attached to the server.
258+
- `filesystem_id` - (Optional) The unique ID of the filesystem attached to the server.
259259

260260
- `enable_ipv6` - (Defaults to `false`) Determines if IPv6 is enabled for the server.
261261
Deprecated: Please use a scaleway_instance_ip with a `routed_ipv6` type.
@@ -319,7 +319,7 @@ In addition to all arguments above, the following attributes are exported:
319319
- `root_volume`
320320
- `volume_id` - The volume ID of the root volume of the server.
321321
- `filesystem`
322-
- `state` - The current status of the filesystem (e.g., attached, detached).
322+
- `state` - The current status of the filesystem (e.g., attached, detached).
323323
- `private_ip` - The Scaleway internal IP address of the server (Deprecated use [ipam_ip datasource](../data-sources/ipam_ip.md#instance-private-network-ip) instead).
324324
- `public_ip` - The public IP address of the server (Deprecated use `public_ips` instead).
325325
- `public_ips` - The list of public IPs of the server.

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
@@ -106,31 +106,6 @@ func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
106106
})
107107
}
108108

109-
func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
110-
tt := acctest.NewTestTools(t)
111-
defer tt.Cleanup()
112-
113-
fileSystemName := "TestAccFileSystem_Basic"
114-
size := int64(25_000_000_000)
115-
116-
resource.ParallelTest(t, resource.TestCase{
117-
PreCheck: func() { acctest.PreCheck(t) },
118-
ProviderFactories: tt.ProviderFactories,
119-
CheckDestroy: filetestfuncs.CheckFileDestroy(tt),
120-
Steps: []resource.TestStep{
121-
{
122-
Config: fmt.Sprintf(`
123-
resource "scaleway_file_filesystem" "fs" {
124-
name = "%s"
125-
size = %d
126-
}
127-
`, fileSystemName, size),
128-
ExpectError: regexp.MustCompile("size does not respect constraint, size must be greater or equal to 100000000000"),
129-
},
130-
},
131-
})
132-
}
133-
134109
func testAccCheckFileSystemExists(tt *acctest.TestTools, n string) resource.TestCheckFunc {
135110
return func(s *terraform.State) error {
136111
rs, ok := s.RootModule().Resources[n]

internal/services/instance/server.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -539,17 +539,17 @@ 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"]
547+
547548
_, err := api.AttachServerFileSystem(&instanceSDK.AttachServerFileSystemRequest{
548549
Zone: zone,
549550
FilesystemID: regional.ExpandID(filesystemID.(string)).ID,
550551
ServerID: res.Server.ID,
551552
})
552-
553553
if err != nil {
554554
return nil
555555
}
@@ -1120,8 +1120,8 @@ func ResourceInstanceServerUpdate(ctx context.Context, d *schema.ResourceData, m
11201120
if d.HasChange("filesystems") {
11211121
oldRaw, newRaw := d.GetChange("filesystems")
11221122

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

11261126
oldIDs := make(map[string]struct{})
11271127
newIDs := make(map[string]struct{})
@@ -1252,6 +1252,7 @@ func attachNewFileSystem(newIDs map[string]struct{}, oldIDs map[string]struct{},
12521252
}
12531253
}
12541254
}
1255+
12551256
return nil, false
12561257
}
12571258

@@ -1268,12 +1269,13 @@ func detachOlDFileSystem(oldIDs map[string]struct{}, newIDs map[string]struct{},
12681269
}
12691270
}
12701271
}
1272+
12711273
return nil, false
12721274
}
12731275

1274-
func collectFilesystemIDs(fsList []interface{}, target map[string]struct{}) {
1276+
func collectFilesystemIDs(fsList []any, target map[string]struct{}) {
12751277
for _, fs := range fsList {
1276-
if fsMap, ok := fs.(map[string]interface{}); ok {
1278+
if fsMap, ok := fs.(map[string]any); ok {
12771279
id := fsMap["filesystem_id"].(string)
12781280
target[id] = struct{}{}
12791281
}
@@ -1319,14 +1321,17 @@ func ResourceInstanceServerDelete(ctx context.Context, d *schema.ResourceData, m
13191321

13201322
// Detach filesystem
13211323
if filesystems, ok := d.GetOk("filesystems"); ok {
1322-
fsList := filesystems.([]interface{})
1324+
fsList := filesystems.([]any)
13231325
for i, fsRaw := range fsList {
1324-
fsMap := fsRaw.(map[string]interface{})
1326+
fsMap := fsRaw.(map[string]any)
1327+
13251328
fsIDRaw, ok := fsMap["filesystem_id"]
13261329
if !ok || fsIDRaw == nil {
13271330
return diag.Errorf("filesystem_id is missing or nil for filesystem at index %d", i)
13281331
}
1332+
13291333
fsID := fsIDRaw.(string)
1334+
13301335
newFileSystemID := types.ExpandStringPtr(fsID)
13311336
if newFileSystemID == nil {
13321337
return diag.Errorf("failed to expand filesystem_id pointer at index %d", i)

internal/services/instance/types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package instance
22

33
import (
4-
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional"
54
"strconv"
65

76
"github.com/scaleway/scaleway-sdk-go/api/instance/v1"
87
"github.com/scaleway/scaleway-sdk-go/scw"
8+
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional"
99
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/zonal"
1010
)
1111

@@ -102,12 +102,12 @@ func flattenServerPublicIPs(zone scw.Zone, ips []*instance.ServerIP) []any {
102102
return flattenedIPs
103103
}
104104

105-
func flattenServerFileSystem(zone scw.Zone, fs []*instance.ServerFilesystem) []interface{} {
106-
filesystems := make([]interface{}, len(fs))
105+
func flattenServerFileSystem(zone scw.Zone, fs []*instance.ServerFilesystem) []any {
106+
filesystems := make([]any, len(fs))
107107
region, _ := zone.Region()
108108

109109
for i, f := range fs {
110-
filesystems[i] = map[string]interface{}{
110+
filesystems[i] = map[string]any{
111111
"filesystem_id": regional.NewIDString(region, f.FilesystemID),
112112
"status": f.State,
113113
}

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)