Skip to content

Commit 7c6aae2

Browse files
committed
fix review
1 parent a6debee commit 7c6aae2

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

docs/data-sources/baremetal_easy_partitioning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
subcategory: "Elastic Metal"
3-
page_title: "Scaleway: scaleway_easy_partitioningr"
3+
page_title: "Scaleway: scaleway_baremetal_easy_partitioning"
44
---
55

6-
# scaleway_easy_partitioning
6+
# scaleway_baremetal_easy_partitioning
77

88
The scaleway_easy_partitioning data source allows you to retrieve a ready-to-use partitioning schema for a BareMetal server. This schema can be used for custom installations with optional swap and extra partitions.
99

internal/services/baremetal/easy_partitioning_data_source.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import (
1515
"github.com/scaleway/terraform-provider-scaleway/v2/internal/verify"
1616
)
1717

18+
const (
19+
partitionSize = 20000000000
20+
)
21+
1822
func DataEasyPartitioning() *schema.Resource {
1923
return &schema.Resource{
2024
ReadContext: dataEasyPartitioningRead,
@@ -43,15 +47,15 @@ func DataEasyPartitioning() *schema.Resource {
4347
Default: true,
4448
Description: "set extra ext_4 partition",
4549
},
46-
"ext_4_mountpoint": { // TODO change to mount point
50+
"ext_4_mountpoint": {
4751
Type: schema.TypeString,
4852
Optional: true,
4953
Default: "/hello",
5054
Description: "Mount point must be an absolute path with alphanumeric characters and underscores",
5155
},
5256
"json_partition": {
5357
Type: schema.TypeString,
54-
Optional: true,
58+
Computed: true,
5559
Description: "The partitioning schema in json format",
5660
},
5761
},
@@ -180,7 +184,7 @@ func removeSwap(originalDisks []*baremetal.SchemaDisk, withExtraPartition bool)
180184
p.Size = 0
181185
p.UseAllAvailableSpace = true
182186
} else {
183-
p.Size = 20000000000
187+
p.Size = partitionSize
184188
}
185189
}
186190

@@ -232,7 +236,7 @@ func manageRootSize(originalDisks []*baremetal.SchemaDisk, withSwap bool, withEx
232236
}
233237

234238
if withExtraPartition {
235-
partition.Size = 20000000000
239+
partition.Size = partitionSize
236240
}
237241
}
238242
}

0 commit comments

Comments
 (0)