Skip to content

Commit be3e6a4

Browse files
authored
feat(secret): add support for scheduled_for_deletion (#4535)
1 parent 3306535 commit be3e6a4

File tree

6 files changed

+24
-15
lines changed

6 files changed

+24
-15
lines changed

cmd/scw/testdata/test-all-usage-secret-secret-list-usage.golden

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ USAGE:
66
scw secret secret list [arg=value ...]
77

88
ARGS:
9-
[project-id] Filter by Project ID (optional)
10-
[order-by] (name_asc | name_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc)
11-
[tags.{index}] List of tags to filter on (optional)
12-
[name] Filter by secret name (optional)
13-
[path] Filter by exact path (optional)
14-
[ephemeral] Filter by ephemeral / not ephemeral (optional)
15-
[type] Filter by secret type (optional) (unknown_type | opaque | certificate | key_value | basic_credentials | database_credentials | ssh_key)
16-
[organization-id] Filter by Organization ID (optional)
17-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
9+
[project-id] Filter by Project ID (optional)
10+
[order-by] (name_asc | name_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc)
11+
[tags.{index}] List of tags to filter on (optional)
12+
[name] Filter by secret name (optional)
13+
[path] Filter by exact path (optional)
14+
[ephemeral] Filter by ephemeral / not ephemeral (optional)
15+
[type] Filter by secret type (optional) (unknown_type | opaque | certificate | key_value | basic_credentials | database_credentials | ssh_key)
16+
[scheduled-for-deletion] Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional)
17+
[organization-id] Filter by Organization ID (optional)
18+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
1819

1920
FLAGS:
2021
-h, --help help for list

cmd/scw/testdata/test-all-usage-secret-version-list-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ USAGE:
77

88
ARGS:
99
secret-id ID of the secret
10-
[status.{index}] Filter results by status (unknown_status | enabled | disabled | deleted)
10+
[status.{index}] Filter results by status (unknown_status | enabled | disabled | deleted | scheduled_for_deletion)
1111
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
1212

1313
FLAGS:

docs/commands/secret.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ scw secret secret list [arg=value ...]
160160
| path | | Filter by exact path (optional) |
161161
| ephemeral | | Filter by ephemeral / not ephemeral (optional) |
162162
| type | One of: `unknown_type`, `opaque`, `certificate`, `key_value`, `basic_credentials`, `database_credentials`, `ssh_key` | Filter by secret type (optional) |
163+
| scheduled-for-deletion | | Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional) |
163164
| organization-id | | Filter by Organization ID (optional) |
164165
| 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 |
165166

@@ -457,7 +458,7 @@ scw secret version list <secret-id ...> [arg=value ...]
457458
| Name | | Description |
458459
|------|---|-------------|
459460
| secret-id | Required | ID of the secret |
460-
| status.{index} | One of: `unknown_status`, `enabled`, `disabled`, `deleted` | Filter results by status |
461+
| status.{index} | One of: `unknown_status`, `enabled`, `disabled`, `deleted`, `scheduled_for_deletion` | Filter results by status |
461462
| 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 |
462463

463464

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.20250218143128-3136832efdcc
28+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250220095325-5f0d193bad95
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.20250218143128-3136832efdcc h1:YfW5EvR+6f6pGAoAY3Yu2Li4dmLbRxz28S+Nwf+bS+s=
462-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250218143128-3136832efdcc/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
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=
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/secret/v1beta1/secret_cli.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,13 @@ func secretSecretList() *core.Command {
374374
Positional: false,
375375
EnumValues: []string{"unknown_type", "opaque", "certificate", "key_value", "basic_credentials", "database_credentials", "ssh_key"},
376376
},
377+
{
378+
Name: "scheduled-for-deletion",
379+
Short: `Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional)`,
380+
Required: false,
381+
Deprecated: false,
382+
Positional: false,
383+
},
377384
{
378385
Name: "organization-id",
379386
Short: `Filter by Organization ID (optional)`,
@@ -752,7 +759,7 @@ func secretVersionList() *core.Command {
752759
Required: false,
753760
Deprecated: false,
754761
Positional: false,
755-
EnumValues: []string{"unknown_status", "enabled", "disabled", "deleted"},
762+
EnumValues: []string{"unknown_status", "enabled", "disabled", "deleted", "scheduled_for_deletion"},
756763
},
757764
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)),
758765
},

0 commit comments

Comments
 (0)