Skip to content

Commit

Permalink
minor renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
tvoran committed Sep 13, 2024
1 parent 4b2479f commit d31cc62
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions helpers/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,15 +509,16 @@ func (s *SecretDataBuilder) WithHVSAppSecrets(resp *hvsclient.OpenAppSecretsOK,
case HVSSecretTypeRotating:
// Since rotating secrets have multiple values, prefix each key with
// the secret name to avoid collisions.
for rvk, rvv := range v.RotatingVersion.Values {
rName := fmt.Sprintf("%s_%s", v.Name, rvk)
secrets[rName] = rvv
for rotatingKey, rotatingValue := range v.RotatingVersion.Values {
prefixedKey := fmt.Sprintf("%s_%s", v.Name, rotatingKey)
secrets[prefixedKey] = rotatingValue
}
case HVSSecretTypeDynamic:
// Since dynamic secrets have multiple values, prefix each key with
// the secret name to avoid collisions.
for dynamicKey, dynamicValue := range v.DynamicInstance.Values {
secrets[v.Name+"_"+dynamicKey] = dynamicValue
prefixedKey := fmt.Sprintf("%s_%s", v.Name, dynamicKey)
secrets[prefixedKey] = dynamicValue
}
default:
continue
Expand Down

0 comments on commit d31cc62

Please sign in to comment.