Skip to content

Commit e3b9d76

Browse files
feat(redis): allow filtering the list of Clusters using version attribute (#2560)
Co-authored-by: Rémy Léone <[email protected]>
1 parent eb38dd3 commit e3b9d76

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ARGS:
1010
[name] Name of the clusters to filter upon
1111
[order-by] Criteria to use when ordering cluster listing (created_at_asc | created_at_desc | name_asc | name_desc)
1212
[project-id] Project ID to list the cluster of
13+
[version] Version of the clusters to filter upon
1314
[organization-id] Organization ID to list the cluster of
1415
[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-1)
1516

docs/commands/redis.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ scw redis cluster list [arg=value ...]
241241
| name | | Name of the clusters to filter upon |
242242
| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Criteria to use when ordering cluster listing |
243243
| project-id | | Project ID to list the cluster of |
244+
| version | | Version of the clusters to filter upon |
244245
| organization-id | | Organization ID to list the cluster of |
245246
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config |
246247

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98
1919
github.com/mattn/go-colorable v0.1.13
2020
github.com/mattn/go-isatty v0.0.16
21-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021090213-af5c083146b1
21+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221025083458-eee4b9bd7660
2222
github.com/spf13/cobra v1.6.1
2323
github.com/spf13/pflag v1.0.5
2424
github.com/stretchr/testify v1.8.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw
7171
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
7272
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
7373
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
74-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021090213-af5c083146b1 h1:iIJOeHT9KHf8gqt8iFVPuPBkIQddUket5AyFdfrv0Jg=
75-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021090213-af5c083146b1/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
74+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221025083458-eee4b9bd7660 h1:5M5cNSXGDMtxB/hBDwMSkrllHO0iqNCP3irPrrBc7GA=
75+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221025083458-eee4b9bd7660/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
7676
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
7777
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
7878
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=

internal/namespaces/redis/v1/redis_cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ func redisClusterList() *core.Command {
367367
Deprecated: false,
368368
Positional: false,
369369
},
370+
{
371+
Name: "version",
372+
Short: `Version of the clusters to filter upon`,
373+
Required: false,
374+
Deprecated: false,
375+
Positional: false,
376+
},
370377
{
371378
Name: "organization-id",
372379
Short: `Organization ID to list the cluster of`,

0 commit comments

Comments
 (0)