Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
Revert "add required user and pass"
Browse files Browse the repository at this point in the history
This reverts commit 351f238.
  • Loading branch information
iyuroch committed Apr 10, 2022
1 parent 351f238 commit 820f283
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions controllers/factory/alertmanager/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,22 +744,27 @@ func (cb *configBuilder) buildHTTPConfig(httpCfg *operatorv1beta1.HTTPConfig) (y

func (cb *configBuilder) buildBasicAuth(basicAuth *operatorv1beta1.BasicAuth) (yaml.MapSlice, error) {
var r yaml.MapSlice
u, err := cb.fetchSecretValue(&basicAuth.Username)
if err != nil {
return nil, err
}
r = append(r, yaml.MapItem{
Key: "username",
Value: string(u),
})
p, err := cb.fetchSecretValue(&basicAuth.Password)
if err != nil {
return nil, err
}
r = append(r, yaml.MapItem{
Key: "password",
Value: string(p),
})

if basicAuth.Username != nil {
u, err := cb.fetchSecretValue(&basicAuth.Username)
if err != nil {
return nil, err
}
r = append(r, yaml.MapItem{
Key: "username",
Value: string(u),
})
}
if basicAuth.Password != nil {
p, err := cb.fetchSecretValue(&basicAuth.Password)
if err != nil {
return nil, err
}
r = append(r, yaml.MapItem{
Key: "password",
Value: string(p),
})
}
if len(basicAuth.PasswordFile) > 0 {
r = append(r, yaml.MapItem{
Key: "password_file",
Expand Down

0 comments on commit 820f283

Please sign in to comment.