Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ To **delete** existing secrets for a given app name and scope, run:
vault delete secret/data/$KAIGARA_DEPLOYMENT_ID/$KAIGARA_APP_NAME/*scope*
```

To delete all versions and metadata for the provided key for a given app name and scope, run:
```sh
vault kv metadata delete secret/$KAIGARA_DEPLOYMENT_ID/$KAIGARA_APP_NAME/*scope*
```
This command don't remove the underlying version data from storage, it will mark the version as deleted which allows the version to be undeleted - `vault kv undelete`, while next command will make version data permanently deleted:
```sh
vault kv metadata destroy secret/$KAIGARA_DEPLOYMENT_ID/$KAIGARA_APP_NAME/*scope*
```

### Bulk writing secrets to the SecretStore

To write secrets from the command line, save in a YAML file with a format similar to `secrets.yaml` and use `kaisave -f *filepath*`
Expand Down
2 changes: 1 addition & 1 deletion pkg/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (vs *Service) LoadSecrets(appName, scope string) error {
vs.metadata[appName] = make(map[string]interface{})
}

if secret == nil || secret.Data == nil || secret.Data["data"] == nil {
if secret == nil || secret.Data == nil || secret.Data["data"] == nil || secret.Data["metadata"] == nil {
vs.data[appName][scope] = make(map[string]interface{})
vs.metadata[appName][scope] = make(map[string]interface{})
} else {
Expand Down