Skip to content

Commit 640ea2c

Browse files
authored
Merge branch 'scaleway:master' into master
2 parents b5154f5 + c49f16d commit 640ea2c

11 files changed

+150
-17
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ scw-cli-v2-version
1010
# To avoid having differences in case you use a different shell than bash while recording the goldens
1111
docs/commands/autocomplete.md
1212

13-
scw
13+
# Ignore the binary
14+
/scw
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
If no pool is specified, all pools of the cluster will be migrated to new images.
4+
5+
USAGE:
6+
scw k8s pool migrate-to-new-images [arg=value ...]
7+
8+
EXAMPLES:
9+
Migrate all pools of a cluster to new images
10+
scw k8s pool migrate-to-new-images cluster-id=11111111-1111-1111-1111-111111111111
11+
12+
Migrate a specific pool of a cluster to new images
13+
scw k8s pool migrate-to-new-images cluster-id=11111111-1111-1111-1111-111111111111 pools.0=22222222-2222-2222-2222-222222222222
14+
15+
ARGS:
16+
cluster-id
17+
[pool-ids.{index}]
18+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
19+
20+
FLAGS:
21+
-h, --help help for migrate-to-new-images
22+
23+
GLOBAL FLAGS:
24+
-c, --config string The path to the config file
25+
-D, --debug Enable debug mode
26+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
27+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-k8s-pool-usage.golden

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ USAGE:
77
scw k8s pool <command>
88

99
AVAILABLE COMMANDS:
10-
add-external-node Add an external node to a Kosmos Pool
11-
create Create a new Pool in a Cluster
12-
delete Delete a Pool in a Cluster
13-
get Get a Pool in a Cluster
14-
list List Pools in a Cluster
15-
update Update a Pool in a Cluster
16-
upgrade Upgrade a Pool in a Cluster
10+
add-external-node Add an external node to a Kosmos Pool
11+
create Create a new Pool in a Cluster
12+
delete Delete a Pool in a Cluster
13+
get Get a Pool in a Cluster
14+
list List Pools in a Cluster
15+
migrate-to-new-images Migrate specific pools or all pools of a cluster to new images.
16+
update Update a Pool in a Cluster
17+
upgrade Upgrade a Pool in a Cluster
1718

1819
WORKFLOW COMMANDS:
19-
wait Wait for a pool to reach a stable state
20+
wait Wait for a pool to reach a stable state
2021

2122
FLAGS:
2223
-h, --help help for pool

docs/commands/k8s.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ This API allows you to manage Kubernetes Kapsule and Kosmos clusters.
3838
- [Delete a Pool in a Cluster](#delete-a-pool-in-a-cluster)
3939
- [Get a Pool in a Cluster](#get-a-pool-in-a-cluster)
4040
- [List Pools in a Cluster](#list-pools-in-a-cluster)
41+
- [Migrate specific pools or all pools of a cluster to new images.](#migrate-specific-pools-or-all-pools-of-a-cluster-to-new-images.)
4142
- [Update a Pool in a Cluster](#update-a-pool-in-a-cluster)
4243
- [Upgrade a Pool in a Cluster](#upgrade-a-pool-in-a-cluster)
4344
- [Wait for a pool to reach a stable state](#wait-for-a-pool-to-reach-a-stable-state)
@@ -1121,6 +1122,42 @@ scw k8s pool list cluster-id=11111111-1111-1111-1111-111111111111 order-by=creat
11211122

11221123

11231124

1125+
### Migrate specific pools or all pools of a cluster to new images.
1126+
1127+
If no pool is specified, all pools of the cluster will be migrated to new images.
1128+
1129+
**Usage:**
1130+
1131+
```
1132+
scw k8s pool migrate-to-new-images [arg=value ...]
1133+
```
1134+
1135+
1136+
**Args:**
1137+
1138+
| Name | | Description |
1139+
|------|---|-------------|
1140+
| cluster-id | Required | |
1141+
| pool-ids.{index} | | |
1142+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
1143+
1144+
1145+
**Examples:**
1146+
1147+
1148+
Migrate all pools of a cluster to new images
1149+
```
1150+
scw k8s pool migrate-to-new-images cluster-id=11111111-1111-1111-1111-111111111111
1151+
```
1152+
1153+
Migrate a specific pool of a cluster to new images
1154+
```
1155+
scw k8s pool migrate-to-new-images cluster-id=11111111-1111-1111-1111-111111111111 pools.0=22222222-2222-2222-2222-222222222222
1156+
```
1157+
1158+
1159+
1160+
11241161
### Update a Pool in a Cluster
11251162

11261163
Update the attributes of a specific pool, such as its desired size, autoscaling settings, and tags. To upgrade a pool, you will need to use the dedicated endpoint.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ require (
2323
github.com/mattn/go-isatty v0.0.20
2424
github.com/moby/buildkit v0.13.2
2525
github.com/opencontainers/go-digest v1.0.0
26-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250630080509-bd2b86613e39
26+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250716080040-6038c5316f66
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2828
github.com/spf13/cobra v1.9.1
29-
github.com/spf13/pflag v1.0.6
29+
github.com/spf13/pflag v1.0.7
3030
github.com/stretchr/testify v1.10.0
3131
golang.org/x/crypto v0.40.0
3232
golang.org/x/sync v0.16.0

go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
466466
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
467467
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
468468
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
469-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250630080509-bd2b86613e39 h1:Xean40tUO2sN0pODaLwh+wLz5NYI578PPVIFJgob7cM=
470-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250630080509-bd2b86613e39/go.mod h1:zFWiHphneiey3s8HOtAEnGrRlWivNaxW5T6d5Xfco7g=
469+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250716080040-6038c5316f66 h1:cdds9CiMBdb9rLJ9xlbTkCtCXfux41nxx3j6+qtCf0Q=
470+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.34.0.20250716080040-6038c5316f66/go.mod h1:fw6BmcfYRs2BEHYW0c3/rR0JgZHvdx6uMYqpeUJx3Bc=
471471
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
472472
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
473473
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
@@ -493,8 +493,9 @@ github.com/spdx/tools-golang v0.5.3 h1:ialnHeEYUC4+hkm5vJm4qz2x+oEJbS0mAMFrNXdQr
493493
github.com/spdx/tools-golang v0.5.3/go.mod h1:/ETOahiAo96Ob0/RAIBmFZw6XN0yTnyr/uFZm2NTMhI=
494494
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
495495
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
496-
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
497496
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
497+
github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M=
498+
github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
498499
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
499500
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
500501
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=

internal/namespaces/baremetal/v1/testdata/test-create-server-simple-default.golden

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Domain -
1414
BootType normal
1515
Zone fr-par-2
1616
PingStatus unknown
17+
Protected false
1718

1819
IPs:
1920
ID ADDRESS REVERSE VERSION REVERSE STATUS REVERSE STATUS MESSAGE
@@ -59,5 +60,6 @@ ID NAME STATUS MANAGEABLE EXPIRES AT
5960
"install": null,
6061
"ping_status": "ping_status_unknown",
6162
"options": [],
62-
"rescue_server": null
63+
"rescue_server": null,
64+
"protected": false
6365
}

internal/namespaces/baremetal/v1/testdata/test-install-server-simple-all-ssh-keys.golden

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Domain 94f3192e-3a74-4a78-8d78-33047c5aa28c.fr-par-2.baremetal.scw.clou
1414
BootType normal
1515
Zone fr-par-2
1616
PingStatus unknown
17+
Protected false
1718

1819
IPs:
1920
ID ADDRESS REVERSE VERSION REVERSE STATUS REVERSE STATUS MESSAGE
@@ -249,5 +250,6 @@ PartitioningSchema.Filesystems.2.Mountpoint /
249250
},
250251
"ping_status": "ping_status_unknown",
251252
"options": [],
252-
"rescue_server": null
253+
"rescue_server": null,
254+
"protected": false
253255
}

internal/namespaces/baremetal/v1/testdata/test-install-server-simple-with-id.golden

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Domain 4741beac-6994-4ae2-8ced-bb8a05790a06.fr-par-2.baremetal.scw.clou
1414
BootType normal
1515
Zone fr-par-2
1616
PingStatus unknown
17+
Protected false
1718

1819
IPs:
1920
ID ADDRESS REVERSE VERSION REVERSE STATUS REVERSE STATUS MESSAGE
@@ -219,5 +220,6 @@ PartitioningSchema.Filesystems.2.Mountpoint /
219220
},
220221
"ping_status": "ping_status_unknown",
221222
"options": [],
222-
"rescue_server": null
223+
"rescue_server": null,
224+
"protected": false
223225
}

internal/namespaces/baremetal/v1/testdata/test-list-server-simple.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ e54658ca-e08d-473a-aad1-d3f31a8a5551 cli-bm-friendly-brahmagupta EM-I215E-NVME
4242
"ping_status": "ping_status_up",
4343
"options": [],
4444
"rescue_server": null,
45+
"protected": false,
4546
"offer_name": "EM-I215E-NVME"
4647
},
4748
{
@@ -193,6 +194,7 @@ e54658ca-e08d-473a-aad1-d3f31a8a5551 cli-bm-friendly-brahmagupta EM-I215E-NVME
193194
"ping_status": "ping_status_unknown",
194195
"options": [],
195196
"rescue_server": null,
197+
"protected": false,
196198
"offer_name": "EM-I215E-NVME"
197199
},
198200
{
@@ -335,6 +337,7 @@ e54658ca-e08d-473a-aad1-d3f31a8a5551 cli-bm-friendly-brahmagupta EM-I215E-NVME
335337
"ping_status": "ping_status_unknown",
336338
"options": [],
337339
"rescue_server": null,
340+
"protected": false,
338341
"offer_name": "EM-I215E-NVME"
339342
}
340343
]

0 commit comments

Comments
 (0)