From 61e27beabc9804fdcf59ed9df2180802175a4f70 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 28 Aug 2018 10:05:26 -0700 Subject: Updating dependancies. (#9303) --- vendor/gopkg.in/olivere/elastic.v5/.travis.yml | 27 ++++++++++------ vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS | 2 ++ vendor/gopkg.in/olivere/elastic.v5/client.go | 11 ++----- .../gopkg.in/olivere/elastic.v5/config/config.go | 37 ++++++++++------------ vendor/gopkg.in/olivere/elastic.v5/errors.go | 21 ++++++++++-- vendor/gopkg.in/olivere/elastic.v5/go.mod | 8 +++++ vendor/gopkg.in/olivere/elastic.v5/go.sum | 8 +++++ .../gopkg.in/olivere/elastic.v5/indices_stats.go | 27 ++++++++++------ vendor/gopkg.in/olivere/elastic.v5/run-es.sh | 2 +- .../search_queries_simple_query_string.go | 11 +++++++ .../elastic.v5/snapshot_create_repository.go | 2 +- 11 files changed, 105 insertions(+), 51 deletions(-) create mode 100644 vendor/gopkg.in/olivere/elastic.v5/go.mod create mode 100644 vendor/gopkg.in/olivere/elastic.v5/go.sum (limited to 'vendor/gopkg.in') diff --git a/vendor/gopkg.in/olivere/elastic.v5/.travis.yml b/vendor/gopkg.in/olivere/elastic.v5/.travis.yml index d88c9c642..24e24ecc8 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/.travis.yml +++ b/vendor/gopkg.in/olivere/elastic.v5/.travis.yml @@ -1,16 +1,25 @@ sudo: required language: go -script: go test -race -v . ./config go: - - 1.x - - tip +- "1.10.x" +- "1.11rc1" +#- tip +env: +- GO111MODULE=on matrix: allow_failures: - - go: tip + - go: tip services: - - docker +- docker before_install: - - go get github.com/fortytw2/leaktest - - sudo sysctl -w vm.max_map_count=262144 - - docker run --rm --privileged=true -p 9200:9200 -p 9300:9300 -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:5.6.9 elasticsearch -Expack.security.enabled=false -Escript.inline=true -Escript.stored=true -Escript.file=true -Enetwork.host=_local_,_site_ -Enetwork.publish_host=_local_ >& /dev/null & - - sleep 30 +# Install netcat +- if [[ "$TRAVIS_OS_NAME" == "linux" && ! $(which nc) ]] ; then sudo apt-get install -y netcat ; fi +- sudo sysctl -w vm.max_map_count=262144 +- docker run --rm --privileged=true -p 9200:9200 -p 9300:9300 -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:5.6.10 elasticsearch -Expack.security.enabled=false -Escript.inline=true -Escript.stored=true -Escript.file=true -Enetwork.host=_local_,_site_ -Enetwork.publish_host=_local_ >& /dev/null & +- go get -u github.com/fortytw2/leaktest +- go get . ./config/... ./aws/... +# Wait for Elasticsearch +- while ! nc -z localhost 9200; do sleep 1; done +install: true +script: +- go test -race -v . ./aws/... ./config/... diff --git a/vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS b/vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS index 55fe6d95a..1beea081f 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS +++ b/vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS @@ -34,6 +34,7 @@ cforbes [@cforbes](https://github.com/cforbes) Chris M [@tebriel](https://github.com/tebriel) Chris Rice [@donutmonger](https://github.com/donutmonger) Claudiu Olteanu [@claudiuolteanu](https://github.com/claudiuolteanu) +Chris Duncan [@veqryn](https://github.com/veqryn) Christophe Courtaut [@kri5](https://github.com/kri5) Connor Peet [@connor4312](https://github.com/connor4312) Conrad Pankoff [@deoxxa](https://github.com/deoxxa) @@ -69,6 +70,7 @@ Jacob [@jdelgad](https://github.com/jdelgad) Jayme Rotsaert [@jrots](https://github.com/jrots) Jeff Rand [@jeffrand](https://github.com/jeffrand) Jeremy Canady [@jrmycanady](https://github.com/jrmycanady) +Jérémie Vexiau [@texvex](https://github.com/texvex) Jim Berlage [@jimberlage](https://github.com/jimberlage) Joe Buck [@four2five](https://github.com/four2five) John Barker [@j16r](https://github.com/j16r) diff --git a/vendor/gopkg.in/olivere/elastic.v5/client.go b/vendor/gopkg.in/olivere/elastic.v5/client.go index 2e190a579..b5f5c75ad 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/client.go +++ b/vendor/gopkg.in/olivere/elastic.v5/client.go @@ -26,7 +26,7 @@ import ( const ( // Version is the current version of Elastic. - Version = "5.0.70" + Version = "5.0.74" // DefaultURL is the default endpoint of Elasticsearch on the local machine. // It is used e.g. when initializing a new Client without a specific URL. @@ -1301,17 +1301,10 @@ func (c *Client) PerformRequestWithOptions(ctx context.Context, opt PerformReque // Get response res, err := c.c.Do((*http.Request)(req).WithContext(ctx)) - if err == context.Canceled || err == context.DeadlineExceeded { + if IsContextErr(err) { // Proceed, but don't mark the node as dead return nil, err } - if ue, ok := err.(*url.Error); ok { - // This happens e.g. on redirect errors, see https://golang.org/src/net/http/client_test.go#L329 - if ue.Err == context.Canceled || ue.Err == context.DeadlineExceeded || ue.Temporary() { - // Proceed, but don't mark the node as dead - return nil, err - } - } if err != nil { n++ wait, ok, rerr := retrier.Retry(ctx, n, (*http.Request)(req), res, err) diff --git a/vendor/gopkg.in/olivere/elastic.v5/config/config.go b/vendor/gopkg.in/olivere/elastic.v5/config/config.go index a511c4157..208eb2b5d 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/config/config.go +++ b/vendor/gopkg.in/olivere/elastic.v5/config/config.go @@ -13,16 +13,17 @@ import ( // Config represents an Elasticsearch configuration. type Config struct { - URL string - Index string - Username string - Password string - Shards int - Replicas int - Sniff *bool - Infolog string - Errorlog string - Tracelog string + URL string + Index string + Username string + Password string + Shards int + Replicas int + Sniff *bool + Healthcheck *bool + Infolog string + Errorlog string + Tracelog string } // Parse returns the Elasticsearch configuration by extracting it @@ -44,16 +45,7 @@ func Parse(elasticURL string) (*Config, error) { if err != nil { return nil, fmt.Errorf("error parsing elastic parameter %q: %v", elasticURL, err) } - index := uri.Path - if strings.HasPrefix(index, "/") { - index = index[1:] - } - if strings.HasSuffix(index, "/") { - index = index[:len(index)-1] - } - if index == "" { - return nil, fmt.Errorf("missing index in elastic parameter %q", elasticURL) - } + index := strings.TrimSuffix(strings.TrimPrefix(uri.Path, "/"), "/") if uri.User != nil { cfg.Username = uri.User.Username() cfg.Password, _ = uri.User.Password() @@ -71,6 +63,11 @@ func Parse(elasticURL string) (*Config, error) { cfg.Sniff = &b } } + if s := uri.Query().Get("healthcheck"); s != "" { + if b, err := strconv.ParseBool(s); err == nil { + cfg.Healthcheck = &b + } + } if s := uri.Query().Get("infolog"); s != "" { cfg.Infolog = s } diff --git a/vendor/gopkg.in/olivere/elastic.v5/errors.go b/vendor/gopkg.in/olivere/elastic.v5/errors.go index e40cda845..2aeff6b4b 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/errors.go +++ b/vendor/gopkg.in/olivere/elastic.v5/errors.go @@ -5,10 +5,12 @@ package elastic import ( + "context" "encoding/json" "fmt" "io/ioutil" "net/http" + "net/url" "github.com/pkg/errors" ) @@ -86,9 +88,24 @@ type ErrorDetails struct { func (e *Error) Error() string { if e.Details != nil && e.Details.Reason != "" { return fmt.Sprintf("elastic: Error %d (%s): %s [type=%s]", e.Status, http.StatusText(e.Status), e.Details.Reason, e.Details.Type) - } else { - return fmt.Sprintf("elastic: Error %d (%s)", e.Status, http.StatusText(e.Status)) } + return fmt.Sprintf("elastic: Error %d (%s)", e.Status, http.StatusText(e.Status)) +} + +// IsContextErr returns true if the error is from a context that was canceled or deadline exceeded +func IsContextErr(err error) bool { + if err == context.Canceled || err == context.DeadlineExceeded { + return true + } + // This happens e.g. on redirect errors, see https://golang.org/src/net/http/client_test.go#L329 + if ue, ok := err.(*url.Error); ok { + if ue.Temporary() { + return true + } + // Use of an AWS Signing Transport can result in a wrapped url.Error + return IsContextErr(ue.Err) + } + return false } // IsConnErr returns true if the error indicates that Elastic could not diff --git a/vendor/gopkg.in/olivere/elastic.v5/go.mod b/vendor/gopkg.in/olivere/elastic.v5/go.mod new file mode 100644 index 000000000..a29017697 --- /dev/null +++ b/vendor/gopkg.in/olivere/elastic.v5/go.mod @@ -0,0 +1,8 @@ +module gopkg.in/olivere/elastic.v5 + +require ( + github.com/fortytw2/leaktest v1.2.0 + github.com/mailru/easyjson v0.0.0-20180730094502-03f2033d19d5 + github.com/pkg/errors v0.8.0 + github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 +) diff --git a/vendor/gopkg.in/olivere/elastic.v5/go.sum b/vendor/gopkg.in/olivere/elastic.v5/go.sum new file mode 100644 index 000000000..87d299f80 --- /dev/null +++ b/vendor/gopkg.in/olivere/elastic.v5/go.sum @@ -0,0 +1,8 @@ +github.com/fortytw2/leaktest v1.2.0 h1:cj6GCiwJDH7l3tMHLjZDo0QqPtrXJiWSI9JgpeQKw+Q= +github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/mailru/easyjson v0.0.0-20180730094502-03f2033d19d5 h1:0x4qcEHDpruK6ML/m/YSlFUUu0UpRD3I2PHsNCuGnyA= +github.com/mailru/easyjson v0.0.0-20180730094502-03f2033d19d5/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9 h1:hp2CYQUINdZMHdvTdXtPOY2ainKl4IoMcpAXEf2xj3Q= +github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= diff --git a/vendor/gopkg.in/olivere/elastic.v5/indices_stats.go b/vendor/gopkg.in/olivere/elastic.v5/indices_stats.go index 90ae6837a..0ede37845 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/indices_stats.go +++ b/vendor/gopkg.in/olivere/elastic.v5/indices_stats.go @@ -274,17 +274,26 @@ type IndexStatsGet struct { } type IndexStatsSearch struct { - OpenContexts int64 `json:"open_contexts,omitempty"` - QueryTotal int64 `json:"query_total,omitempty"` - QueryTime string `json:"query_time,omitempty"` - QueryTimeInMillis int64 `json:"query_time_in_millis,omitempty"` - QueryCurrent int64 `json:"query_current,omitempty"` - FetchTotal int64 `json:"fetch_total,omitempty"` - FetchTime string `json:"fetch_time,omitempty"` - FetchTimeInMillis int64 `json:"fetch_time_in_millis,omitempty"` - FetchCurrent int64 `json:"fetch_current,omitempty"` + OpenContexts int64 `json:"open_contexts,omitempty"` + QueryTotal int64 `json:"query_total,omitempty"` + QueryTime string `json:"query_time,omitempty"` + QueryTimeInMillis int64 `json:"query_time_in_millis,omitempty"` + QueryCurrent int64 `json:"query_current,omitempty"` + FetchTotal int64 `json:"fetch_total,omitempty"` + FetchTime string `json:"fetch_time,omitempty"` + FetchTimeInMillis int64 `json:"fetch_time_in_millis,omitempty"` + FetchCurrent int64 `json:"fetch_current,omitempty"` + ScrollTotal int64 `json:"scroll_total,omitempty"` + ScrollTime string `json:"scroll_time,omitempty"` + ScrollTimeInMillis int64 `json:"scroll_time_in_millis,omitempty"` + ScrollCurrent int64 `json:"scroll_current,omitempty"` + SuggestTotal int64 `json:"suggest_total,omitempty"` + SuggestTime string `json:"suggest_time,omitempty"` + SuggestTimeInMillis int64 `json:"suggest_time_in_millis,omitempty"` + SuggestCurrent int64 `json:"suggest_current,omitempty"` } + type IndexStatsMerges struct { Current int64 `json:"current,omitempty"` CurrentDocs int64 `json:"current_docs,omitempty"` diff --git a/vendor/gopkg.in/olivere/elastic.v5/run-es.sh b/vendor/gopkg.in/olivere/elastic.v5/run-es.sh index 26814f0d0..68967a5c3 100755 --- a/vendor/gopkg.in/olivere/elastic.v5/run-es.sh +++ b/vendor/gopkg.in/olivere/elastic.v5/run-es.sh @@ -1,3 +1,3 @@ #!/bin/sh -VERSION=${VERSION:=5.6.9} +VERSION=${VERSION:=5.6.10} docker run --rm --privileged=true -p 9200:9200 -p 9300:9300 -v "$PWD/etc:/usr/share/elasticsearch/config" -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:$VERSION elasticsearch -Expack.security.enabled=false -Expack.ml.enabled=false -Escript.inline=true -Escript.stored=true -Escript.file=true diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_queries_simple_query_string.go b/vendor/gopkg.in/olivere/elastic.v5/search_queries_simple_query_string.go index 764fa0a20..4a1d0e5f3 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/search_queries_simple_query_string.go +++ b/vendor/gopkg.in/olivere/elastic.v5/search_queries_simple_query_string.go @@ -19,6 +19,7 @@ import ( type SimpleQueryStringQuery struct { queryText string analyzer string + quoteFieldSuffix string operator string fields []string fieldBoosts map[string]*float64 @@ -73,6 +74,13 @@ func (q *SimpleQueryStringQuery) Analyzer(analyzer string) *SimpleQueryStringQue return q } +// QuoteFieldSuffix is an optional field name suffix to automatically +// try and add to the field searched when using quoted text. +func (q *SimpleQueryStringQuery) QuoteFieldSuffix(quoteFieldSuffix string) *SimpleQueryStringQuery { + q.quoteFieldSuffix = quoteFieldSuffix + return q +} + // DefaultOperator specifies the default operator for the query. func (q *SimpleQueryStringQuery) DefaultOperator(defaultOperator string) *SimpleQueryStringQuery { q.operator = defaultOperator @@ -177,6 +185,9 @@ func (q *SimpleQueryStringQuery) Source() (interface{}, error) { if q.minimumShouldMatch != "" { query["minimum_should_match"] = q.minimumShouldMatch } + if q.quoteFieldSuffix != "" { + query["quote_field_suffix"] = q.quoteFieldSuffix + } if q.boost != nil { query["boost"] = *q.boost } diff --git a/vendor/gopkg.in/olivere/elastic.v5/snapshot_create_repository.go b/vendor/gopkg.in/olivere/elastic.v5/snapshot_create_repository.go index 9fc0a32a6..e4188495b 100644 --- a/vendor/gopkg.in/olivere/elastic.v5/snapshot_create_repository.go +++ b/vendor/gopkg.in/olivere/elastic.v5/snapshot_create_repository.go @@ -150,7 +150,7 @@ func (s *SnapshotCreateRepositoryService) Validate() error { if s.repository == "" { invalid = append(invalid, "Repository") } - if s.bodyString == "" && s.bodyJson == nil { + if s.bodyString == "" && s.bodyJson == nil && len(s.settings) == 0 { invalid = append(invalid, "BodyJson") } if len(invalid) > 0 { -- cgit v1.2.3-1-g7c22