Skip to content

Commit 0a90c1e

Browse files
committed
fixed password endline bug
Signed-off-by: Shashank <[email protected]>
1 parent 9013059 commit 0a90c1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/configs/db/db.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"net/url"
88
"os"
9+
"strings"
910

1011
"github.com/cortexproject/cortex/pkg/configs/db/memory"
1112
"github.com/cortexproject/cortex/pkg/configs/db/postgres"
@@ -77,7 +78,8 @@ func New(cfg Config) (DB, error) {
7778
if err != nil {
7879
return nil, fmt.Errorf("Could not read database password file: %v", err)
7980
}
80-
u.User = url.UserPassword(u.User.Username(), string(passwordBytes))
81+
password := strings.TrimSpace(string(passwordBytes))
82+
u.User = url.UserPassword(u.User.Username(), password)
8183
}
8284

8385
var d DB

0 commit comments

Comments
 (0)