Skip to content

Commit 08ca134

Browse files
feat(baremetal): support overriding default SSH keys on rescue (#4980)
Co-authored-by: Laure-di <62625835+Laure-di@users.noreply.github.com>
1 parent 3c64f7c commit 08ca134

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ EXAMPLES:
1313
scw baremetal server reboot 11111111-1111-1111-1111-111111111111 boot-type=rescue
1414

1515
ARGS:
16-
server-id ID of the server to reboot
17-
[boot-type=normal] The type of boot (unknown_boot_type | normal | rescue)
18-
[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)
16+
server-id ID of the server to reboot
17+
[boot-type=normal] The type of boot (unknown_boot_type | normal | rescue)
18+
[ssh-key-ids.{index}] Additional SSH public key IDs to configure on rescue image
19+
[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)
1920

2021
FLAGS:
2122
-h, --help help for reboot

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ EXAMPLES:
1313
scw baremetal server start 11111111-1111-1111-1111-111111111111 boot-type=rescue
1414

1515
ARGS:
16-
server-id ID of the server to start
17-
[boot-type] The type of boot (unknown_boot_type | normal | rescue)
18-
[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)
16+
server-id ID of the server to start
17+
[boot-type] The type of boot (unknown_boot_type | normal | rescue)
18+
[ssh-key-ids.{index}] Additional SSH public key IDs to configure on rescue image
19+
[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)
1920

2021
FLAGS:
2122
-h, --help help for start

docs/commands/baremetal.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ scw baremetal server reboot <server-id ...> [arg=value ...]
788788
|------|---|-------------|
789789
| server-id | Required | ID of the server to reboot |
790790
| boot-type | Default: `normal`<br />One of: `unknown_boot_type`, `normal`, `rescue` | The type of boot |
791+
| ssh-key-ids.{index} | | Additional SSH public key IDs to configure on rescue image |
791792
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
792793

793794

@@ -824,6 +825,7 @@ scw baremetal server start <server-id ...> [arg=value ...]
824825
|------|---|-------------|
825826
| server-id | Required | ID of the server to start |
826827
| boot-type | One of: `unknown_boot_type`, `normal`, `rescue` | The type of boot |
828+
| ssh-key-ids.{index} | | Additional SSH public key IDs to configure on rescue image |
827829
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
828830

829831

internal/namespaces/baremetal/v1/baremetal_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,13 @@ func baremetalServerReboot() *core.Command {
944944
"rescue",
945945
},
946946
},
947+
{
948+
Name: "ssh-key-ids.{index}",
949+
Short: `Additional SSH public key IDs to configure on rescue image`,
950+
Required: false,
951+
Deprecated: false,
952+
Positional: false,
953+
},
947954
core.ZoneArgSpec(
948955
scw.ZoneFrPar1,
949956
scw.ZoneFrPar2,
@@ -1003,6 +1010,13 @@ func baremetalServerStart() *core.Command {
10031010
"rescue",
10041011
},
10051012
},
1013+
{
1014+
Name: "ssh-key-ids.{index}",
1015+
Short: `Additional SSH public key IDs to configure on rescue image`,
1016+
Required: false,
1017+
Deprecated: false,
1018+
Positional: false,
1019+
},
10061020
core.ZoneArgSpec(
10071021
scw.ZoneFrPar1,
10081022
scw.ZoneFrPar2,

0 commit comments

Comments
 (0)