Skip to content

Commit

Permalink
Handle vault deleted versions (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraliv13 authored Dec 6, 2023
1 parent 8cdc9a1 commit 8fe3206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func getSecretWithKubernetesAuth(platform, namespace, domain, role string) ([]se
if err != nil {
return fmt.Errorf("unable to read secret: %w", err)
}
if secret == nil {
if secret == nil || secret.Data["data"] == nil {
return nil
}
secretData, ok := secret.Data["data"].(map[string]interface{})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ func exportToVault(ctx *pulumi.Context, secretPath string, templateContext inter
}).(pulumi.StringOutput)

_, err := vault.NewSecret(ctx, secretPath, &vault.SecretArgs{
DataJson: dataJson,
Path: pulumi.String(secretPath),
DataJson: dataJson,
Path: pulumi.String(secretPath),
DeleteAllVersions: pulumi.Bool(true),
}, opts...)
return err
}
Expand Down

0 comments on commit 8fe3206

Please sign in to comment.