Skip to content
Snippets Groups Projects
Commit d2f9fc7d authored by Sergei Smolianinov's avatar Sergei Smolianinov Committed by Daniel Nelson
Browse files

Fix ACL token usage in consul input plugin (#3376)

parent 77cc0717
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,10 @@ func (c *Consul) createAPIClient() (*api.Client, error) { ...@@ -69,6 +69,10 @@ func (c *Consul) createAPIClient() (*api.Client, error) {
config.Datacenter = c.Datacentre config.Datacenter = c.Datacentre
} }
if c.Token != "" {
config.Token = c.Token
}
if c.Username != "" { if c.Username != "" {
config.HttpAuth = &api.HttpBasicAuth{ config.HttpAuth = &api.HttpBasicAuth{
Username: c.Username, Username: c.Username,
......
...@@ -20,7 +20,7 @@ var sampleChecks = []*api.HealthCheck{ ...@@ -20,7 +20,7 @@ var sampleChecks = []*api.HealthCheck{
}, },
} }
func TestGatherHealtCheck(t *testing.T) { func TestGatherHealthCheck(t *testing.T) {
expectedFields := map[string]interface{}{ expectedFields := map[string]interface{}{
"check_name": "foo.health", "check_name": "foo.health",
"status": "passing", "status": "passing",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment