Skip to content

Commit

Permalink
fix unmarshal number into string (#114)
Browse files Browse the repository at this point in the history
Signed-off-by: Elad Kaplan <[email protected]>
  • Loading branch information
kaplanelad authored Jun 21, 2022
1 parent d92fc1f commit 8c37a9d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/providers/aws_secretsmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,17 @@ func (a *AWSSecretsManager) getSecret(kp core.KeyPath) (map[string]string, error
return nil, fmt.Errorf("data not found at %q", kp.Path)
}

var secret map[string]string
var secret map[string]interface{}
err = json.Unmarshal([]byte(*res.SecretString), &secret)
if err != nil {
return nil, err
}

return secret, nil
stringParse := map[string]string{}
for k, v := range secret {
stringParse[k] = fmt.Sprintf("%v", v)
}
return stringParse, nil
case errors.As(err, &resNotFoundErr):
// doesn't exist - do not treat as an error
return nil, nil
Expand Down

0 comments on commit 8c37a9d

Please sign in to comment.