Skip to content

Commit

Permalink
fix: eliminate possible newline after the secret_id
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenschneider committed Oct 18, 2021
1 parent 8c1c29d commit e7452b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/certstorage/vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"io/ioutil"
"net/url"
"path"
"strings"
"time"
)

Expand Down Expand Up @@ -402,7 +403,8 @@ func (vault *VaultBackend) getSecretId(conf config.VaultConfig) (string, error)
if err != nil {
return "", fmt.Errorf("could not read secret_id from specified file %s: %v", conf.SecretIdFile, err)
}
secretId = string(read)
// eliminate a possibly written newline after the secret_id
secretId = strings.TrimSuffix(string(read), "\n")
}
return secretId, nil
}
Expand Down

0 comments on commit e7452b9

Please sign in to comment.