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())
|
||||
|
||||
clientConfig := lokiclient.Config{
|
||||
LokiURL: l.Config.URL,
|
||||
Headers: l.Config.Headers,
|
||||
Limit: l.Config.Limit,
|
||||
Query: l.Config.Query,
|
||||
Since: l.Config.Since,
|
||||
LokiURL: l.Config.URL,
|
||||
Headers: l.Config.Headers,
|
||||
Limit: l.Config.Limit,
|
||||
Query: l.Config.Query,
|
||||
Since: l.Config.Since,
|
||||
Username: l.Config.Auth.Username,
|
||||
Password: l.Config.Auth.Password,
|
||||
}
|
||||
|
||||
l.Client = lokiclient.NewLokiClient(clientConfig)
|
||||
|
|
|
@ -82,7 +82,10 @@ query: >
|
|||
config: `
|
||||
mode: tail
|
||||
source: loki
|
||||
url: http://foo:bar@localhost:3100/
|
||||
url: http://@localhost:3100/
|
||||
auth:
|
||||
username: foo
|
||||
password: bar
|
||||
query: >
|
||||
{server="demo"}
|
||||
`,
|
||||
|
@ -99,16 +102,12 @@ query: >
|
|||
lokiSource := loki.LokiSource{}
|
||||
err := lokiSource.Configure([]byte(test.config), subLogger)
|
||||
cstest.AssertErrorContains(t, err, test.expectedErr)
|
||||
/*if test.password == "" {
|
||||
if lokiSource.auth != nil {
|
||||
t.Fatalf("No auth should be here : %v", lokiSource.auth)
|
||||
}
|
||||
} else {
|
||||
p, _ := lokiSource.auth.Password()
|
||||
if test.password != "" {
|
||||
p := lokiSource.Config.Auth.Password
|
||||
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 lokiSource.Config.WaitForReady != test.waitForReady {
|
||||
t.Fatalf("Wrong WaitForReady %v != %v", lokiSource.Config.WaitForReady, test.waitForReady)
|
||||
|
|
Loading…
Reference in a new issue