Skip to content

Commit

Permalink
Log the reason why the governance-policy-database secret is invalid
Browse files Browse the repository at this point in the history
Looking at the errors returned from url.Parse, no sensitive data is
returned.

Signed-off-by: mprahl <[email protected]>
(cherry picked from commit 59dfbb7)
  • Loading branch information
mprahl authored and Magic Mirror committed Feb 22, 2024
1 parent 5de1707 commit e6911e4
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,7 @@ func ParseDBSecret(dbSecret *corev1.Secret, tempDirPath string) (string, error)
if dbSecret.Data["connectionURL"] != nil {
connectionURL, err = url.Parse(strings.TrimSpace(string(dbSecret.Data["connectionURL"])))
if err != nil {
err := fmt.Errorf(
"%w: failed to parse the connectionURL value, but not logging the error to protect sensitive data",
ErrInvalidDBSecret,
)
err := fmt.Errorf("%w: failed to parse the connectionURL value: %w", ErrInvalidDBSecret, err)

return "", err
}
Expand Down

0 comments on commit e6911e4

Please sign in to comment.