fix: Update auth yaml config
This commit is contained in:
parent
784703ac64
commit
810f525531
|
@ -119,11 +119,13 @@ func (l *LokiSource) Configure(config []byte, logger *log.Entry) error {
|
||||||
l.logger.Infof("Since value: %s", l.Config.Since.String())
|
l.logger.Infof("Since value: %s", l.Config.Since.String())
|
||||||
|
|
||||||
clientConfig := lokiclient.Config{
|
clientConfig := lokiclient.Config{
|
||||||
LokiURL: l.Config.URL,
|
LokiURL: l.Config.URL,
|
||||||
Headers: l.Config.Headers,
|
Headers: l.Config.Headers,
|
||||||
Limit: l.Config.Limit,
|
Limit: l.Config.Limit,
|
||||||
Query: l.Config.Query,
|
Query: l.Config.Query,
|
||||||
Since: l.Config.Since,
|
Since: l.Config.Since,
|
||||||
|
Username: l.Config.Auth.Username,
|
||||||
|
Password: l.Config.Auth.Password,
|
||||||
}
|
}
|
||||||
|
|
||||||
l.Client = lokiclient.NewLokiClient(clientConfig)
|
l.Client = lokiclient.NewLokiClient(clientConfig)
|
||||||
|
|
|
@ -82,7 +82,10 @@ query: >
|
||||||
config: `
|
config: `
|
||||||
mode: tail
|
mode: tail
|
||||||
source: loki
|
source: loki
|
||||||
url: http://foo:bar@localhost:3100/
|
url: http://@localhost:3100/
|
||||||
|
auth:
|
||||||
|
username: foo
|
||||||
|
password: bar
|
||||||
query: >
|
query: >
|
||||||
{server="demo"}
|
{server="demo"}
|
||||||
`,
|
`,
|
||||||
|
@ -99,16 +102,12 @@ query: >
|
||||||
lokiSource := loki.LokiSource{}
|
lokiSource := loki.LokiSource{}
|
||||||
err := lokiSource.Configure([]byte(test.config), subLogger)
|
err := lokiSource.Configure([]byte(test.config), subLogger)
|
||||||
cstest.AssertErrorContains(t, err, test.expectedErr)
|
cstest.AssertErrorContains(t, err, test.expectedErr)
|
||||||
/*if test.password == "" {
|
if test.password != "" {
|
||||||
if lokiSource.auth != nil {
|
p := lokiSource.Config.Auth.Password
|
||||||
t.Fatalf("No auth should be here : %v", lokiSource.auth)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
p, _ := lokiSource.auth.Password()
|
|
||||||
if test.password != p {
|
if test.password != p {
|
||||||
t.Fatalf("Bad password %s != %s", test.password, p)
|
t.Fatalf("Password mismatch : %s != %s", test.password, p)
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
if test.waitForReady != 0 {
|
if test.waitForReady != 0 {
|
||||||
if lokiSource.Config.WaitForReady != test.waitForReady {
|
if lokiSource.Config.WaitForReady != test.waitForReady {
|
||||||
t.Fatalf("Wrong WaitForReady %v != %v", lokiSource.Config.WaitForReady, test.waitForReady)
|
t.Fatalf("Wrong WaitForReady %v != %v", lokiSource.Config.WaitForReady, test.waitForReady)
|
||||||
|
|
Loading…
Reference in a new issue