Skip to content

Commit abc6854

Browse files
feat(baremetal): add max_size instead of specific size for partitioning (#4586)
Co-authored-by: Laure-di <[email protected]>
1 parent d6920c5 commit abc6854

File tree

6 files changed

+71
-55
lines changed

6 files changed

+71
-55
lines changed

cmd/scw/testdata/test-all-usage-baremetal-server-create-usage.golden

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,37 @@ EXAMPLES:
1010
scw baremetal server create
1111

1212
ARGS:
13-
[project-id] Project ID to use. If none is passed the default project ID will be used
14-
name=<generated> Name of the server (≠hostname)
15-
[description] Description associated with the server, max 255 characters
16-
[type] Server commercial type
17-
[tags.{index}] Tags to associate to the server
18-
[install.os-id] ID of the OS to installation on the server
19-
[install.hostname] Hostname of the server
20-
[install.ssh-key-ids.{index}] SSH key IDs authorized on the server
21-
[install.user] User for the installation
22-
[install.password] Password for the installation
23-
[install.service-user] Regular user that runs the service to be installed on the server
24-
[install.service-password] Password used for the service to install
25-
[install.partitioning-schema.disks.{index}.device]
26-
[install.partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
27-
[install.partitioning-schema.disks.{index}.partitions.{index}.number]
28-
[install.partitioning-schema.disks.{index}.partitions.{index}.size]
29-
[install.partitioning-schema.raids.{index}.name]
30-
[install.partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
31-
[install.partitioning-schema.raids.{index}.devices.{index}]
32-
[install.partitioning-schema.filesystems.{index}.device]
33-
[install.partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
34-
[install.partitioning-schema.filesystems.{index}.mountpoint]
35-
[install.partitioning-schema.zfs.pools.{index}.name]
36-
[install.partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
37-
[install.partitioning-schema.zfs.pools.{index}.devices.{index}]
38-
[install.partitioning-schema.zfs.pools.{index}.options.{index}]
39-
[install.partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
40-
[option-ids.{index}] IDs of options to enable on server
41-
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
42-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-2 | pl-waw-3)
13+
[project-id] Project ID to use. If none is passed the default project ID will be used
14+
name=<generated> Name of the server (≠hostname)
15+
[description] Description associated with the server, max 255 characters
16+
[type] Server commercial type
17+
[tags.{index}] Tags to associate to the server
18+
[install.os-id] ID of the OS to installation on the server
19+
[install.hostname] Hostname of the server
20+
[install.ssh-key-ids.{index}] SSH key IDs authorized on the server
21+
[install.user] User for the installation
22+
[install.password] Password for the installation
23+
[install.service-user] Regular user that runs the service to be installed on the server
24+
[install.service-password] Password used for the service to install
25+
[install.partitioning-schema.disks.{index}.device]
26+
[install.partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
27+
[install.partitioning-schema.disks.{index}.partitions.{index}.number]
28+
[install.partitioning-schema.disks.{index}.partitions.{index}.size]
29+
[install.partitioning-schema.disks.{index}.partitions.{index}.use-all-available-space]
30+
[install.partitioning-schema.raids.{index}.name]
31+
[install.partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
32+
[install.partitioning-schema.raids.{index}.devices.{index}]
33+
[install.partitioning-schema.filesystems.{index}.device]
34+
[install.partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
35+
[install.partitioning-schema.filesystems.{index}.mountpoint]
36+
[install.partitioning-schema.zfs.pools.{index}.name]
37+
[install.partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
38+
[install.partitioning-schema.zfs.pools.{index}.devices.{index}]
39+
[install.partitioning-schema.zfs.pools.{index}.options.{index}]
40+
[install.partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
41+
[option-ids.{index}] IDs of options to enable on server
42+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
43+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-2 | pl-waw-3)
4344

4445
FLAGS:
4546
-h, --help help for create

cmd/scw/testdata/test-all-usage-baremetal-server-install-usage.golden

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,29 @@ ARGS:
1414
os-id ID of the OS to installation on the server
1515
hostname Hostname of the server
1616
ssh (one of):
17-
[all-ssh-keys] Add all SSH keys on your baremetal instance (cannot be used with ssh-key-ids)
18-
ssh-key-ids.{index} SSH key IDs authorized on the server (cannot be used with all-ssh-keys)
19-
[user] User used for the installation
20-
[password] Password used for the installation
21-
[service-user] User used for the service to install
22-
[service-password] Password used for the service to install
23-
[partitioning-schema.disks.{index}.device]
24-
[partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
25-
[partitioning-schema.disks.{index}.partitions.{index}.number]
26-
[partitioning-schema.disks.{index}.partitions.{index}.size]
27-
[partitioning-schema.raids.{index}.name]
28-
[partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
29-
[partitioning-schema.raids.{index}.devices.{index}]
30-
[partitioning-schema.filesystems.{index}.device]
31-
[partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
32-
[partitioning-schema.filesystems.{index}.mountpoint]
33-
[partitioning-schema.zfs.pools.{index}.name]
34-
[partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
35-
[partitioning-schema.zfs.pools.{index}.devices.{index}]
36-
[partitioning-schema.zfs.pools.{index}.options.{index}]
37-
[partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
38-
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-2 | pl-waw-3)
17+
[all-ssh-keys] Add all SSH keys on your baremetal instance (cannot be used with ssh-key-ids)
18+
ssh-key-ids.{index} SSH key IDs authorized on the server (cannot be used with all-ssh-keys)
19+
[user] User used for the installation
20+
[password] Password used for the installation
21+
[service-user] User used for the service to install
22+
[service-password] Password used for the service to install
23+
[partitioning-schema.disks.{index}.device]
24+
[partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
25+
[partitioning-schema.disks.{index}.partitions.{index}.number]
26+
[partitioning-schema.disks.{index}.partitions.{index}.size]
27+
[partitioning-schema.disks.{index}.partitions.{index}.use-all-available-space]
28+
[partitioning-schema.raids.{index}.name]
29+
[partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
30+
[partitioning-schema.raids.{index}.devices.{index}]
31+
[partitioning-schema.filesystems.{index}.device]
32+
[partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
33+
[partitioning-schema.filesystems.{index}.mountpoint]
34+
[partitioning-schema.zfs.pools.{index}.name]
35+
[partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
36+
[partitioning-schema.zfs.pools.{index}.devices.{index}]
37+
[partitioning-schema.zfs.pools.{index}.options.{index}]
38+
[partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
39+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-2 | pl-waw-3)
3940

4041
FLAGS:
4142
-h, --help help for install

docs/commands/baremetal.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ scw baremetal server create [arg=value ...]
549549
| install.partitioning-schema.disks.{index}.partitions.{index}.label | One of: `unknown_partition_label`, `uefi`, `legacy`, `root`, `boot`, `swap`, `data`, `home`, `raid`, `zfs` | |
550550
| install.partitioning-schema.disks.{index}.partitions.{index}.number | | |
551551
| install.partitioning-schema.disks.{index}.partitions.{index}.size | | |
552+
| install.partitioning-schema.disks.{index}.partitions.{index}.use-all-available-space | | |
552553
| install.partitioning-schema.raids.{index}.name | | |
553554
| install.partitioning-schema.raids.{index}.level | One of: `unknown_raid_level`, `raid_level_0`, `raid_level_1`, `raid_level_5`, `raid_level_6`, `raid_level_10` | |
554555
| install.partitioning-schema.raids.{index}.devices.{index} | | |
@@ -684,6 +685,7 @@ scw baremetal server install <server-id ...> [arg=value ...]
684685
| partitioning-schema.disks.{index}.partitions.{index}.label | One of: `unknown_partition_label`, `uefi`, `legacy`, `root`, `boot`, `swap`, `data`, `home`, `raid`, `zfs` | |
685686
| partitioning-schema.disks.{index}.partitions.{index}.number | | |
686687
| partitioning-schema.disks.{index}.partitions.{index}.size | | |
688+
| partitioning-schema.disks.{index}.partitions.{index}.use-all-available-space | | |
687689
| partitioning-schema.raids.{index}.name | | |
688690
| partitioning-schema.raids.{index}.level | One of: `unknown_raid_level`, `raid_level_0`, `raid_level_1`, `raid_level_5`, `raid_level_6`, `raid_level_10` | |
689691
| partitioning-schema.raids.{index}.devices.{index} | | |

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
github.com/mattn/go-isatty v0.0.20
2626
github.com/moby/buildkit v0.13.2
2727
github.com/opencontainers/go-digest v1.0.0
28-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312144558-0af04b4e364d
28+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250313090359-5b303a6c22ea
2929
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3030
github.com/spf13/cobra v1.9.1
3131
github.com/spf13/pflag v1.0.6

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
458458
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
459459
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
460460
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
461-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312144558-0af04b4e364d h1:crcNANqcAyq7wm80ySMUew10by466BZP57FWCMo8KVw=
462-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250312144558-0af04b4e364d/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
461+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250313090359-5b303a6c22ea h1:GfqjHTlTmAcXcHWVMPCdscAfZMaohw5nVpORA1OlG6I=
462+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250313090359-5b303a6c22ea/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
463463
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
464464
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
465465
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/baremetal/v1/baremetal_cli.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,12 @@ func baremetalServerCreate() *core.Command {
388388
Deprecated: false,
389389
Positional: false,
390390
},
391+
{
392+
Name: "install.partitioning-schema.disks.{index}.partitions.{index}.use-all-available-space",
393+
Required: false,
394+
Deprecated: false,
395+
Positional: false,
396+
},
391397
{
392398
Name: "install.partitioning-schema.raids.{index}.name",
393399
Required: false,
@@ -626,6 +632,12 @@ func baremetalServerInstall() *core.Command {
626632
Deprecated: false,
627633
Positional: false,
628634
},
635+
{
636+
Name: "partitioning-schema.disks.{index}.partitions.{index}.use-all-available-space",
637+
Required: false,
638+
Deprecated: false,
639+
Positional: false,
640+
},
629641
{
630642
Name: "partitioning-schema.raids.{index}.name",
631643
Required: false,

0 commit comments

Comments
 (0)