Skip to content

Commit

Permalink
change tag name to plaintext
Browse files Browse the repository at this point in the history
  • Loading branch information
umegbewe committed Oct 14, 2023
1 parent bfa0a75 commit ca73408
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (

type Config struct {
Secrets map[string]struct {
KeyValue map[string]string `yaml:"key_value,omitempty"`
PlainValue string `yaml:"plain_value,omitempty"`
File string `yaml:"file,omitempty"`
Tags map[string]string `yaml:"tags"`
KeyValue map[string]string `yaml:"key_value,omitempty"`
PlainText string `yaml:"plaintext,omitempty"`
File string `yaml:"file,omitempty"`
Tags map[string]string `yaml:"tags"`
} `yaml:"secrets"`
}

Expand Down Expand Up @@ -81,8 +81,8 @@ func validateConfig(config Config) error {
return fmt.Errorf("secret '%s' has both KeyValue and File set, which is not allowed", name)
}

if secret.KeyValue == nil && secret.File == "" && secret.PlainValue == "" {
return fmt.Errorf("secret '%s' must have either KeyValue, File, or PlainValue set", name)
if secret.KeyValue == nil && secret.File == "" && secret.PlainText == "" {
return fmt.Errorf("secret '%s' must have either KeyValue, File, or PlainText set", name)
}

for tagKey, tagValue := range secret.Tags {
Expand Down Expand Up @@ -124,7 +124,7 @@ func manageSecrets(svc *secretsmanager.SecretsManager, config Config, kms *strin
}
secretValue = string(content)
} else {
secretValue = secret.PlainValue
secretValue = secret.PlainText
}

tags := make([]*secretsmanager.Tag, 0, len(secret.Tags))
Expand Down

0 comments on commit ca73408

Please sign in to comment.