Skip to content

Commit 4a0f7f8

Browse files
authored
feat(block): add tags filter in list snapshots (#4539)
1 parent b8a58f7 commit 4a0f7f8

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

cmd/scw/testdata/test-all-usage-block-snapshot-list-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ARGS:
1010
[project-id] Filter by Project ID
1111
[volume-id] Filter snapshots by the ID of the original volume
1212
[name] Filter snapshots by their names
13+
[tags.{index}] Filter by tags. Only snapshots with one or more matching tags will be returned
1314
[organization-id] Filter by Organization ID
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 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3 | all)
1516

docs/commands/block.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ scw block snapshot list [arg=value ...]
159159
| project-id | | Filter by Project ID |
160160
| volume-id | | Filter snapshots by the ID of the original volume |
161161
| name | | Filter snapshots by their names |
162+
| tags.{index} | | Filter by tags. Only snapshots with one or more matching tags will be returned |
162163
| organization-id | | Filter by Organization ID |
163164
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `fr-par-3`, `nl-ams-1`, `nl-ams-2`, `nl-ams-3`, `pl-waw-1`, `pl-waw-2`, `pl-waw-3`, `all` | Zone to target. If none is passed will use default zone from the config |
164165

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
github.com/mattn/go-isatty v0.0.20
2626
github.com/moby/buildkit v0.13.2
2727
github.com/opencontainers/go-digest v1.0.0
28-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250220095325-5f0d193bad95
28+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250221163117-f29ed0c43f0b
2929
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3030
github.com/spf13/cobra v1.9.1
3131
github.com/spf13/pflag v1.0.6

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
458458
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
459459
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
460460
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
461-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250220095325-5f0d193bad95 h1:nxkDpup9Wj9wBLZGQF4uDYkjBsmGVfPjkhWb3i5rpyk=
462-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250220095325-5f0d193bad95/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
461+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250221163117-f29ed0c43f0b h1:wH0oO5TxuNDylkJBIjB2Qm1puMkwpfHDnyEVVeJl/AM=
462+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250221163117-f29ed0c43f0b/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
463463
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
464464
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
465465
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/block/v1alpha1/block_cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,13 @@ func blockSnapshotList() *core.Command {
412412
Deprecated: false,
413413
Positional: false,
414414
},
415+
{
416+
Name: "tags.{index}",
417+
Short: `Filter by tags. Only snapshots with one or more matching tags will be returned`,
418+
Required: false,
419+
Deprecated: false,
420+
Positional: false,
421+
},
415422
{
416423
Name: "organization-id",
417424
Short: `Filter by Organization ID`,

0 commit comments

Comments
 (0)