Skip to content

Commit 0ea6b33

Browse files
scaleway-botyfodil
andauthored
chore(k8s): remove deprecated features from the cli (#5241)
Co-authored-by: Yacine Fodil <[email protected]>
1 parent 6dc2703 commit 0ea6b33

File tree

3 files changed

+8
-103
lines changed

3 files changed

+8
-103
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ 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-
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
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
1817

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

2221
FLAGS:
2322
-h, --help help for pool

docs/commands/k8s.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ 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.)
4241
- [Update a Pool in a Cluster](#update-a-pool-in-a-cluster)
4342
- [Upgrade a Pool in a Cluster](#upgrade-a-pool-in-a-cluster)
4443
- [Wait for a pool to reach a stable state](#wait-for-a-pool-to-reach-a-stable-state)
@@ -1147,42 +1146,6 @@ scw k8s pool list cluster-id=11111111-1111-1111-1111-111111111111 order-by=creat
11471146

11481147

11491148

1150-
### Migrate specific pools or all pools of a cluster to new images.
1151-
1152-
If no pool is specified, all pools of the cluster will be migrated to new images.
1153-
1154-
**Usage:**
1155-
1156-
```
1157-
scw k8s pool migrate-to-new-images [arg=value ...]
1158-
```
1159-
1160-
1161-
**Args:**
1162-
1163-
| Name | | Description |
1164-
|------|---|-------------|
1165-
| cluster-id | Required | |
1166-
| pool-ids.{index} | | |
1167-
| 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 |
1168-
1169-
1170-
**Examples:**
1171-
1172-
1173-
Migrate all pools of a cluster to new images
1174-
```
1175-
scw k8s pool migrate-to-new-images cluster-id=11111111-1111-1111-1111-111111111111
1176-
```
1177-
1178-
Migrate a specific pool of a cluster to new images
1179-
```
1180-
scw k8s pool migrate-to-new-images cluster-id=11111111-1111-1111-1111-111111111111 pools.0=22222222-2222-2222-2222-222222222222
1181-
```
1182-
1183-
1184-
1185-
11861149
### Update a Pool in a Cluster
11871150

11881151
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.

internal/namespaces/k8s/v1/k8s_cli.go

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func GetGeneratedCommands() *core.Commands {
4646
k8sPoolUpgrade(),
4747
k8sPoolUpdate(),
4848
k8sPoolDelete(),
49-
k8sPoolMigrateToNewImages(),
5049
k8sNodeList(),
5150
k8sNodeGet(),
5251
k8sNodeReplace(),
@@ -2109,62 +2108,6 @@ func k8sPoolDelete() *core.Command {
21092108
}
21102109
}
21112110

2112-
func k8sPoolMigrateToNewImages() *core.Command {
2113-
return &core.Command{
2114-
Short: `Migrate specific pools or all pools of a cluster to new images.`,
2115-
Long: `If no pool is specified, all pools of the cluster will be migrated to new images.`,
2116-
Namespace: "k8s",
2117-
Resource: "pool",
2118-
Verb: "migrate-to-new-images",
2119-
// Deprecated: false,
2120-
ArgsType: reflect.TypeOf(k8s.MigratePoolsToNewImagesRequest{}),
2121-
ArgSpecs: core.ArgSpecs{
2122-
{
2123-
Name: "cluster-id",
2124-
Required: true,
2125-
Deprecated: false,
2126-
Positional: false,
2127-
},
2128-
{
2129-
Name: "pool-ids.{index}",
2130-
Required: false,
2131-
Deprecated: false,
2132-
Positional: false,
2133-
},
2134-
core.RegionArgSpec(
2135-
scw.RegionFrPar,
2136-
scw.RegionNlAms,
2137-
scw.RegionPlWaw,
2138-
),
2139-
},
2140-
Run: func(ctx context.Context, args any) (i any, e error) {
2141-
request := args.(*k8s.MigratePoolsToNewImagesRequest)
2142-
2143-
client := core.ExtractClient(ctx)
2144-
api := k8s.NewAPI(client)
2145-
e = api.MigratePoolsToNewImages(request)
2146-
if e != nil {
2147-
return nil, e
2148-
}
2149-
2150-
return &core.SuccessResult{
2151-
Resource: "pool",
2152-
Verb: "migrate-to-new-images",
2153-
}, nil
2154-
},
2155-
Examples: []*core.Example{
2156-
{
2157-
Short: "Migrate all pools of a cluster to new images",
2158-
Raw: `scw k8s pool migrate-to-new-images cluster-id=11111111-1111-1111-1111-111111111111`,
2159-
},
2160-
{
2161-
Short: "Migrate a specific pool of a cluster to new images",
2162-
Raw: `scw k8s pool migrate-to-new-images cluster-id=11111111-1111-1111-1111-111111111111 pools.0=22222222-2222-2222-2222-222222222222`,
2163-
},
2164-
},
2165-
}
2166-
}
2167-
21682111
func k8sNodeList() *core.Command {
21692112
return &core.Command{
21702113
Short: `List Nodes in a Cluster`,

0 commit comments

Comments
 (0)