Skip to content

Commit

Permalink
Ignore fields not market with tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Stein Fletcher committed Oct 11, 2019
1 parent 27a8ae6 commit 706e0bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions secretsmanager/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func NewProvider(secretsManager secretsmanageriface.SecretsManagerAPI) conf.Prov

func (o asmConf) Provide(field reflect.StructField) (string, error) {
key, opts := parseTag(field, "secret")
if key == "" {
return "", nil
}

defaultValue, _ := parseTag(field, "secretDefault")
isRequired := hasOption(opts, "required")

Expand Down
1 change: 1 addition & 0 deletions secretsmanager/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

type config struct {
OtherField string
SecretPlaintext string `secret:"/my-group/my-secret"`
}

Expand Down

0 comments on commit 706e0bc

Please sign in to comment.