Skip to content

Commit acbdebd

Browse files
authored
feat(k8s): add filter on PrivateNetworkID (#3378)
1 parent e86d0eb commit acbdebd

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ EXAMPLES:
1616
scw k8s cluster list region=fr-par name=cluster1
1717

1818
ARGS:
19-
[project-id] Project ID on which to filter the returned clusters
20-
[order-by] Sort order of 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)
21-
[name] Name to filter on, only clusters containing this substring in their name will be returned
22-
[status] Status to filter on, only clusters with this status will be returned (unknown | creating | ready | deleting | deleted | updating | locked | pool_required)
23-
[type] Type to filter on, only clusters with this type will be returned
24-
[organization-id] Organization ID on which to filter the returned clusters
25-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
19+
[project-id] Project ID on which to filter the returned clusters
20+
[order-by] Sort order of 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)
21+
[name] Name to filter on, only clusters containing this substring in their name will be returned
22+
[status] Status to filter on, only clusters with this status will be returned (unknown | creating | ready | deleting | deleted | updating | locked | pool_required)
23+
[type] Type to filter on, only clusters with this type will be returned
24+
[private-network-id] Private Network ID to filter on, only clusters within this Private Network will be returned
25+
[organization-id] Organization ID on which to filter the returned clusters
26+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
2627

2728
FLAGS:
2829
-h, --help help for list

docs/commands/k8s.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ scw k8s cluster list [arg=value ...]
218218
| name | | Name to filter on, only clusters containing this substring in their name will be returned |
219219
| status | One of: `unknown`, `creating`, `ready`, `deleting`, `deleted`, `updating`, `locked`, `pool_required` | Status to filter on, only clusters with this status will be returned |
220220
| type | | Type to filter on, only clusters with this type will be returned |
221+
| private-network-id | | Private Network ID to filter on, only clusters within this Private Network will be returned |
221222
| organization-id | | Organization ID on which to filter the returned clusters |
222223
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
223224

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20230920081818-d2f8a2eef94c
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20230920140527-e5585b17ed21
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.7.0
3030
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
491491
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
492492
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
493493
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
494-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20230920081818-d2f8a2eef94c h1:ycZnnSiUFyH4YBkkpw81AHrqtDMRn+sf+1qkFSoSUUQ=
495-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20230920081818-d2f8a2eef94c/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
494+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20230920140527-e5585b17ed21 h1:WLj1yXnD9n/vPUIS7/ycRQy49eDrIPyD7R2CeqNVc3M=
495+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20230920140527-e5585b17ed21/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
496496
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
497497
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
498498
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=

internal/namespaces/k8s/v1/k8s_cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ func k8sClusterList() *core.Command {
162162
Deprecated: false,
163163
Positional: false,
164164
},
165+
{
166+
Name: "private-network-id",
167+
Short: `Private Network ID to filter on, only clusters within this Private Network will be returned`,
168+
Required: false,
169+
Deprecated: false,
170+
Positional: false,
171+
},
165172
{
166173
Name: "organization-id",
167174
Short: `Organization ID on which to filter the returned clusters`,

0 commit comments

Comments
 (0)