Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a panic when creating HVS app or secret #1154

Merged
merged 4 commits into from
Dec 16, 2024
Merged
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
3 changes: 3 additions & 0 deletions .changelog/1154.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
Fix a panic when creating HVS app or secret
```
16 changes: 11 additions & 5 deletions internal/clients/vault_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ func CreateVaultSecretsApp(ctx context.Context, client *Client, loc *sharedmodel

createParams := secret_service.NewCreateAppParams()
createParams.Context = ctx
createParams.Body.Name = appName
createParams.Body.Description = description
createParams.Body = &secretmodels.SecretServiceCreateAppBody{
Name: appName,
Description: description,
}
createParams.OrganizationID = loc.OrganizationID
createParams.ProjectID = loc.ProjectID

Expand Down Expand Up @@ -57,7 +59,9 @@ func UpdateVaultSecretsApp(ctx context.Context, client *Client, loc *sharedmodel
updateParams := secret_service.NewUpdateAppParams()
updateParams.Context = ctx
updateParams.Name = appName
updateParams.Body.Description = description
updateParams.Body = &secretmodels.SecretServiceUpdateAppBody{
Description: description,
}
updateParams.OrganizationID = loc.OrganizationID
updateParams.ProjectID = loc.ProjectID

Expand Down Expand Up @@ -92,8 +96,10 @@ func CreateVaultSecretsAppSecret(ctx context.Context, client *Client, loc *share
createParams := secret_service.NewCreateAppKVSecretParams()
createParams.Context = ctx
createParams.AppName = appName
createParams.Body.Name = secretName
createParams.Body.Value = secretValue
createParams.Body = &secretmodels.SecretServiceCreateAppKVSecretBody{
Name: secretName,
Value: secretValue,
}
createParams.OrganizationID = loc.OrganizationID
createParams.ProjectID = loc.ProjectID

Expand Down
Loading