Skip to content

Commit 1d07701

Browse files
committed
fix unit tests
Signed-off-by: Jacob Lisi <jacob.t.lisi@gmail.com>
1 parent 70dc087 commit 1d07701

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

pkg/ruler/notifier_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func TestBuildNotifierConfig(t *testing.T) {
4646
},
4747
},
4848
},
49-
HTTPClientConfig: config_util.HTTPClientConfig{BasicAuth: &config_util.BasicAuth{}},
5049
},
5150
},
5251
},
@@ -74,7 +73,6 @@ func TestBuildNotifierConfig(t *testing.T) {
7473
Port: 0,
7574
},
7675
},
77-
HTTPClientConfig: config_util.HTTPClientConfig{BasicAuth: &config_util.BasicAuth{}},
7876
},
7977
},
8078
},
@@ -106,7 +104,6 @@ func TestBuildNotifierConfig(t *testing.T) {
106104
},
107105
},
108106
},
109-
HTTPClientConfig: config_util.HTTPClientConfig{BasicAuth: &config_util.BasicAuth{}},
110107
},
111108
{
112109
APIVersion: "v1",
@@ -118,7 +115,6 @@ func TestBuildNotifierConfig(t *testing.T) {
118115
},
119116
},
120117
},
121-
HTTPClientConfig: config_util.HTTPClientConfig{BasicAuth: &config_util.BasicAuth{}},
122118
},
123119
},
124120
},
@@ -146,7 +142,6 @@ func TestBuildNotifierConfig(t *testing.T) {
146142
Port: 0,
147143
},
148144
},
149-
HTTPClientConfig: config_util.HTTPClientConfig{BasicAuth: &config_util.BasicAuth{}},
150145
},
151146
{
152147
APIVersion: "v1",
@@ -160,7 +155,6 @@ func TestBuildNotifierConfig(t *testing.T) {
160155
Port: 0,
161156
},
162157
},
163-
HTTPClientConfig: config_util.HTTPClientConfig{BasicAuth: &config_util.BasicAuth{}},
164158
},
165159
},
166160
},

pkg/util/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (b *BasicAuth) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) {
3333

3434
// IsEnabled returns false if basic authentication isn't enabled.
3535
func (b BasicAuth) IsEnabled() bool {
36-
return b.Username == "" && b.Password == ""
36+
return b.Username != "" || b.Password != ""
3737
}
3838

3939
// WriteJSONResponse writes some JSON as a HTTP response.

0 commit comments

Comments
 (0)