Skip to content

Commit 60b03da

Browse files
committed
fix: convertion
1 parent 380b3b7 commit 60b03da

6 files changed

+765
-84
lines changed

internal/services/file/filesystem.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ func ResourceFileSystemRead(ctx context.Context, d *schema.ResourceData, m inter
128128
_ = d.Set("region", fileSystem.Region)
129129
_ = d.Set("organization_id", fileSystem.OrganizationID)
130130
_ = d.Set("status", fileSystem.Status)
131-
_ = d.Set("size", fileSystem.Size)
131+
_ = d.Set("size", int64(fileSystem.Size))
132132
_ = d.Set("tags", fileSystem.Tags)
133133
_ = d.Set("created_at", fileSystem.CreatedAt.Format(time.RFC3339))
134134
_ = d.Set("updated_at", fileSystem.UpdatedAt.Format(time.RFC3339))
135-
_ = d.Set("number_of_attachments", fileSystem.NumberOfAttachments)
135+
_ = d.Set("number_of_attachments", int64(fileSystem.NumberOfAttachments))
136136

137137
return nil
138138
}

internal/services/file/filesystem_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestAccFileSystem_Basic(t *testing.T) {
3737
Check: resource.ComposeTestCheckFunc(
3838
testAccCheckFileSystemExists(tt, "scaleway_file_filesystem.fs"),
3939
resource.TestCheckResourceAttr("scaleway_file_filesystem.fs", "name", fileSystemName),
40-
resource.TestCheckResourceAttr("scaleway_file_filesystem.fs", "size", strconv.FormatInt(int64(size), 10)),
40+
resource.TestCheckResourceAttr("scaleway_file_filesystem.fs", "size", strconv.FormatInt(size, 10)),
4141
),
4242
},
4343
{
@@ -49,7 +49,7 @@ func TestAccFileSystem_Basic(t *testing.T) {
4949
`, fileSystemNameUpdated, size),
5050
Check: resource.ComposeTestCheckFunc(
5151
testAccCheckFileSystemExists(tt, "scaleway_file_filesystem.fs"),
52-
resource.TestCheckResourceAttr("scaleway_file_filesystem.fs", "size", strconv.FormatInt(int64(size), 10)),
52+
resource.TestCheckResourceAttr("scaleway_file_filesystem.fs", "size", strconv.FormatInt(size, 10)),
5353
),
5454
},
5555
},
@@ -60,7 +60,7 @@ func TestAccFileSystem_SizeTooSmallFails(t *testing.T) {
6060
tt := acctest.NewTestTools(t)
6161
defer tt.Cleanup()
6262

63-
fileSystemName := "TestAccFileSystem_Basic"
63+
fileSystemName := "TestAccFileSystem_SizeTooSmallFails"
6464
size := int64(10_000_000_000)
6565

6666
resource.ParallelTest(t, resource.TestCase{
@@ -75,7 +75,7 @@ func TestAccFileSystem_SizeTooSmallFails(t *testing.T) {
7575
size = %d
7676
}
7777
`, fileSystemName, size),
78-
ExpectError: regexp.MustCompile("size does not respect constraint, size must be greater or equal to 100000000000"),
78+
ExpectError: regexp.MustCompile("size must be greater or equal to 100000000000"),
7979
},
8080
},
8181
})
@@ -85,7 +85,7 @@ func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
8585
tt := acctest.NewTestTools(t)
8686
defer tt.Cleanup()
8787

88-
fileSystemName := "TestAccFileSystem_Basic"
88+
fileSystemName := "TestAccFileSystem_InvalidSizeGranularityFails"
8989
size := int64(25_000_000_000)
9090

9191
resource.ParallelTest(t, resource.TestCase{
@@ -100,7 +100,7 @@ func TestAccFileSystem_InvalidSizeGranularityFails(t *testing.T) {
100100
size = %d
101101
}
102102
`, fileSystemName, size),
103-
ExpectError: regexp.MustCompile("size does not respect constraint, size must be greater or equal to 100000000000"),
103+
ExpectError: regexp.MustCompile("size must be greater or equal to 100000000000"),
104104
},
105105
},
106106
})

0 commit comments

Comments
 (0)