Skip to content

Commit 8d857be

Browse files
feat(k8s): add support for k8s types (#1958)
* feat(k8s): add support for k8s types * Fix * Fix * Fix * Fix Co-authored-by: scaleway-bot <[email protected]>
1 parent 223820b commit 8d857be

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ EXAMPLES:
1414

1515
ARGS:
1616
[project-id] Project ID to use. If none is passed the default project ID will be used
17+
[type] The type of the cluster
1718
name=<generated> The name of the cluster
1819
[description] The description of the cluster
1920
[tags.{index}] The tags associated with the cluster

cmd/scw/testdata/test-all-usage-k8s-cluster-list-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ARGS:
2020
[order-by] The sort order of the returned clusters (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | name_asc | name_desc | status_asc | status_desc | version_asc | version_desc)
2121
[name] The name on which to filter the returned clusters
2222
[status] The status on which to filter the returned clusters (unknown | creating | ready | deleting | deleted | updating | locked | pool_required)
23+
[type] The type on which to filter the returned clusters
2324
[organization-id] The organization ID on which to filter the returned clusters
2425
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
2526

docs/commands/k8s.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ scw k8s cluster create [arg=value ...]
5959
| Name | | Description |
6060
|------|---|-------------|
6161
| project-id | | Project ID to use. If none is passed the default project ID will be used |
62+
| type | | The type of the cluster |
6263
| name | Required<br />Default: `<generated>` | The name of the cluster |
6364
| description | | The description of the cluster |
6465
| tags.{index} | | The tags associated with the cluster |
@@ -203,6 +204,7 @@ scw k8s cluster list [arg=value ...]
203204
| order-by | One of: `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc`, `name_asc`, `name_desc`, `status_asc`, `status_desc`, `version_asc`, `version_desc` | The sort order of the returned clusters |
204205
| name | | The name on which to filter the returned clusters |
205206
| status | One of: `unknown`, `creating`, `ready`, `deleting`, `deleted`, `updating`, `locked`, `pool_required` | The status on which to filter the returned clusters |
207+
| type | | The type on which to filter the returned clusters |
206208
| organization-id | | The organization ID on which to filter the returned clusters |
207209
| 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 |
208210

internal/namespaces/k8s/v1/k8s_cli.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ func k8sClusterList() *core.Command {
144144
Positional: false,
145145
EnumValues: []string{"unknown", "creating", "ready", "deleting", "deleted", "updating", "locked", "pool_required"},
146146
},
147+
{
148+
Name: "type",
149+
Short: `The type on which to filter the returned clusters`,
150+
Required: false,
151+
Deprecated: false,
152+
Positional: false,
153+
},
147154
{
148155
Name: "organization-id",
149156
Short: `The organization ID on which to filter the returned clusters`,
@@ -216,6 +223,9 @@ func k8sClusterList() *core.Command {
216223
{
217224
FieldName: "UpdatedAt",
218225
},
226+
{
227+
FieldName: "Type",
228+
},
219229
}},
220230
}
221231
}
@@ -231,6 +241,13 @@ func k8sClusterCreate() *core.Command {
231241
ArgsType: reflect.TypeOf(k8s.CreateClusterRequest{}),
232242
ArgSpecs: core.ArgSpecs{
233243
core.ProjectIDArgSpec(),
244+
{
245+
Name: "type",
246+
Short: `The type of the cluster`,
247+
Required: false,
248+
Deprecated: false,
249+
Positional: false,
250+
},
234251
{
235252
Name: "name",
236253
Short: `The name of the cluster`,

0 commit comments

Comments
 (0)