Skip to content

Commit

Permalink
Pass cacert file with the correct type to the elasticsearch loader (#…
Browse files Browse the repository at this point in the history
…6678)

* Pass cacert file with the correct type to the elasticsearch loader

We were sending the cacert as `[/tmp/cacert]` instead of
[]string{"/tmp/cacert"} making the Elasticsearch loader crash with a
file not found.

* update elasticsearch version and use the correct artifact name for the
snapshot.

* freeze on prometheus 1.5.1 like in master
  • Loading branch information
ph authored and andrewkroh committed Apr 5, 2018
1 parent d832927 commit 4d1905a
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ https://github.com/elastic/beats/compare/v5.6.8...5.6[Check the HEAD diff]

*Affecting all Beats*

- Fix a type issue when specifying certicate authority when using the `import_dashboards` command. {pull}6678[6678]

*Filebeat*

*Heartbeat*
Expand Down
2 changes: 1 addition & 1 deletion libbeat/dashboards/import_dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func ImportDashboards() error {
}

if len(cl.opt.CertificateAuthority) > 0 {
tlsConfig["certificate_authorities"] = fmt.Sprintf("[%s]", cl.opt.CertificateAuthority)
tlsConfig["certificate_authorities"] = []string{cl.opt.CertificateAuthority}
}

if len(tlsConfig) > 0 {
Expand Down
7 changes: 6 additions & 1 deletion libbeat/outputs/elasticsearch/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"sync"
"time"

"github.com/joeshaw/multierror"

"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/common/op"
"github.com/elastic/beats/libbeat/logp"
Expand Down Expand Up @@ -82,15 +84,18 @@ func NewConnectedClient(cfg *common.Config) (*Client, error) {
return nil, err
}

var errs multierror.Errors

for _, client := range clients {
err = client.Connect(client.timeout)
if err != nil {
logp.Err("Error connecting to Elasticsearch: %s", client.Connection.URL)
errs = append(errs, err)
continue
}
return &client, nil
}
return nil, fmt.Errorf("Couldn't connect to any of the configured Elasticsearch hosts")
return nil, fmt.Errorf("Couldn't connect to any of the configured Elasticsearch hosts, errors: %v", errs.Err())
}

// NewElasticsearchClients returns a list of Elasticsearch clients based on the given
Expand Down
4 changes: 2 additions & 2 deletions metricbeat/module/prometheus/_meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM prom/prometheus

FROM prom/prometheus:v1.5.1
HEALTHCHECK --interval=1s --retries=90 CMD nc -w 1 localhost 9090 </dev/null
EXPOSE 9090
2 changes: 1 addition & 1 deletion testing/environments/args.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ services:
build:
args:
DOWNLOAD_URL: https://snapshots.elastic.co/downloads
ELASTIC_VERSION: 5.6.8-SNAPSHOT
ELASTIC_VERSION: 5.6.9-SNAPSHOT
2 changes: 1 addition & 1 deletion testing/environments/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
context: docker/logstash
dockerfile: Dockerfile
args:
ELASTIC_VERSION: 5.4.1
ELASTIC_VERSION: 5.6.8
DOWNLOAD_URL: https://artifacts.elastic.co/downloads
environment:
- ES_HOST=elasticsearch
Expand Down

0 comments on commit 4d1905a

Please sign in to comment.