Skip to content

Commit

Permalink
Add nil check for Ruler BasicAuth config. (#5168)
Browse files Browse the repository at this point in the history
Signed-off-by: Kaviraj <[email protected]>
  • Loading branch information
kavirajk authored Jan 18, 2022
1 parent 985e965 commit dddace8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/ruler/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ func (c *RemoteWriteConfig) Clone() (*RemoteWriteConfig, error) {
// BasicAuth.Password has a type of Secret (github.com/prometheus/common/config/config.go),
// so when its value is marshaled it is obfuscated as "<secret>".
// Here we copy the original password into the cloned config.
n.Client.HTTPClientConfig.BasicAuth.Password = c.Client.HTTPClientConfig.BasicAuth.Password
if n.Client.HTTPClientConfig.BasicAuth != nil {
n.Client.HTTPClientConfig.BasicAuth.Password = c.Client.HTTPClientConfig.BasicAuth.Password
}
return n, nil
}

Expand Down

0 comments on commit dddace8

Please sign in to comment.