Skip to content

Commit

Permalink
feat(secret): add support for scheduled_for_deletion (#4535)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Feb 21, 2025
1 parent 3306535 commit be3e6a4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
19 changes: 10 additions & 9 deletions cmd/scw/testdata/test-all-usage-secret-secret-list-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ USAGE:
scw secret secret list [arg=value ...]

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

FLAGS:
-h, --help help for list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USAGE:

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

FLAGS:
Expand Down
3 changes: 2 additions & 1 deletion docs/commands/secret.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ scw secret secret list [arg=value ...]
| path | | Filter by exact path (optional) |
| ephemeral | | Filter by ephemeral / not ephemeral (optional) |
| type | One of: `unknown_type`, `opaque`, `certificate`, `key_value`, `basic_credentials`, `database_credentials`, `ssh_key` | Filter by secret type (optional) |
| scheduled-for-deletion | | Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional) |
| organization-id | | Filter by Organization ID (optional) |
| 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 |

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


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250218143128-3136832efdcc
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250220095325-5f0d193bad95
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250218143128-3136832efdcc h1:YfW5EvR+6f6pGAoAY3Yu2Li4dmLbRxz28S+Nwf+bS+s=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250218143128-3136832efdcc/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250220095325-5f0d193bad95 h1:nxkDpup9Wj9wBLZGQF4uDYkjBsmGVfPjkhWb3i5rpyk=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250220095325-5f0d193bad95/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
9 changes: 8 additions & 1 deletion internal/namespaces/secret/v1beta1/secret_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,13 @@ func secretSecretList() *core.Command {
Positional: false,
EnumValues: []string{"unknown_type", "opaque", "certificate", "key_value", "basic_credentials", "database_credentials", "ssh_key"},
},
{
Name: "scheduled-for-deletion",
Short: `Filter by whether the secret was scheduled for deletion / not scheduled for deletion (optional)`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "organization-id",
Short: `Filter by Organization ID (optional)`,
Expand Down Expand Up @@ -752,7 +759,7 @@ func secretVersionList() *core.Command {
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"unknown_status", "enabled", "disabled", "deleted"},
EnumValues: []string{"unknown_status", "enabled", "disabled", "deleted", "scheduled_for_deletion"},
},
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)),
},
Expand Down

0 comments on commit be3e6a4

Please sign in to comment.