Skip to content

Commit

Permalink
Fix ACL token usage in consul input plugin (#3376)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Smolianinov authored and danielnelson committed Oct 23, 2017
1 parent db57691 commit b4a0edf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions plugins/inputs/consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func (c *Consul) createAPIClient() (*api.Client, error) {
config.Datacenter = c.Datacentre
}

if c.Token != "" {
config.Token = c.Token
}

if c.Username != "" {
config.HttpAuth = &api.HttpBasicAuth{
Username: c.Username,
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/consul/consul_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var sampleChecks = []*api.HealthCheck{
},
}

func TestGatherHealtCheck(t *testing.T) {
func TestGatherHealthCheck(t *testing.T) {
expectedFields := map[string]interface{}{
"check_name": "foo.health",
"status": "passing",
Expand Down

0 comments on commit b4a0edf

Please sign in to comment.