Skip to content

Commit 1464ded

Browse files
authored
feat(secret-manager): add option to disable previous version when creating a new Secret Version (#2965)
1 parent e5de968 commit 1464ded

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ USAGE:
66
scw secret version create [arg=value ...]
77

88
ARGS:
9-
secret-id ID of the secret
10-
data Content of the secret version. Base64 is handled by the SDK (Support file loading with @/path/to/file)
11-
[description] Description of the version
12-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
9+
secret-id ID of the secret
10+
data Content of the secret version. Base64 is handled by the SDK (Support file loading with @/path/to/file)
11+
[description] Description of the version
12+
[disable-previous] Disable the previous secret version
13+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1314

1415
FLAGS:
1516
-h, --help help for create

docs/commands/secret.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ scw secret version create [arg=value ...]
200200
| secret-id | Required | ID of the secret |
201201
| data | Required | Content of the secret version. Base64 is handled by the SDK |
202202
| description | | Description of the version |
203+
| disable-previous | | Disable the previous secret version |
203204
| region | Default: `fr-par`<br />One of: `fr-par` | Region to target. If none is passed will use default region from the config |
204205

205206

internal/namespaces/secret/v1alpha1/secret_cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,13 @@ func secretVersionCreate() *core.Command {
337337
Deprecated: false,
338338
Positional: false,
339339
},
340+
{
341+
Name: "disable-previous",
342+
Short: `Disable the previous secret version`,
343+
Required: false,
344+
Deprecated: false,
345+
Positional: false,
346+
},
340347
core.RegionArgSpec(scw.RegionFrPar),
341348
},
342349
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

0 commit comments

Comments
 (0)