Skip to content

Commit 9456adb

Browse files
committed
remove all 1x, 2x and 5x ES specific code
1 parent 9fbfef6 commit 9456adb

26 files changed

+593
-1194
lines changed

.ci/Dockerfile.elasticsearch

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ ARG SECURE_INTEGRATION
88

99
RUN rm -f $es_path/config/scripts
1010

11-
COPY --chown=elasticsearch:elasticsearch spec/fixtures/scripts/groovy/* $es_path/config/scripts/
1211
COPY --chown=elasticsearch:elasticsearch spec/fixtures/test_certs/* $es_path/config/test_certs/
1312
COPY --chown=elasticsearch:elasticsearch .ci/elasticsearch-run.sh $es_path/
1413

.ci/logstash-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ else
3232
echo "Waiting for elasticsearch to respond..."
3333
ES_VERSION=$(wait_for_es)
3434
echo "Elasticsearch $ES_VERSION is Up!"
35-
bundle exec rspec -fd $extra_tag_args --tag update_tests:painless --tag update_tests:groovy --tag es_version:$ES_VERSION spec/integration
35+
bundle exec rspec -fd $extra_tag_args --tag update_tests:painless --tag es_version:$ES_VERSION spec/integration
3636
fi

lib/logstash/outputs/elasticsearch/http_client/pool.rb

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -176,23 +176,15 @@ def check_sniff
176176
@logger.warn("Sniff returned no nodes! Will not update hosts.")
177177
return nil
178178
else
179-
case major_version(url_meta[:version])
180-
when 5, 6, 7, 8
181-
sniff_5x_and_above(nodes)
182-
when 2, 1
183-
sniff_2x_1x(nodes)
184-
else
185-
@logger.warn("Could not determine version for nodes in ES cluster!")
186-
return nil
187-
end
179+
sniff(nodes)
188180
end
189181
end
190182

191183
def major_version(version_string)
192184
version_string.split('.').first.to_i
193185
end
194186

195-
def sniff_5x_and_above(nodes)
187+
def sniff(nodes)
196188
nodes.map do |id,info|
197189
# Skip master-only nodes
198190
next if info["roles"] && info["roles"] == ["master"]
@@ -208,24 +200,6 @@ def address_str_to_uri(addr_str)
208200
end
209201
end
210202

211-
def sniff_2x_1x(nodes)
212-
nodes.map do |id,info|
213-
# TODO Make sure this works with shield. Does that listed
214-
# stuff as 'https_address?'
215-
216-
addr_str = info['http_address'].to_s
217-
next unless addr_str # Skip hosts with HTTP disabled
218-
219-
# Only connect to nodes that serve data
220-
# this will skip connecting to client, tribe, and master only nodes
221-
# Note that if 'attributes' is NOT set, then that's just a regular node
222-
# with master + data + client enabled, so we allow that
223-
attributes = info['attributes']
224-
next if attributes && attributes['data'] == 'false'
225-
address_str_to_uri(addr_str)
226-
end.compact
227-
end
228-
229203
def stop_sniffer
230204
@sniffer.join if @sniffer
231205
end

lib/logstash/outputs/elasticsearch/templates/ecs-disabled/elasticsearch-2x.json

Lines changed: 0 additions & 95 deletions
This file was deleted.

lib/logstash/outputs/elasticsearch/templates/ecs-disabled/elasticsearch-5x.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

spec/es_spec_helper.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ def field_properties_from_template(template_name, field)
5353
end
5454

5555
def routing_field_name
56-
if ESHelper.es_version_satisfies?(">=6")
57-
:routing
58-
else
59-
:_routing
60-
end
56+
:routing
6157
end
6258

6359
def self.es_version

spec/fixtures/_nodes/2x_1x.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

spec/fixtures/_nodes/5x_6x.json renamed to spec/fixtures/_nodes/6x.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"transport_address" : "http://localhost:9200",
1212
"host" : "localhost",
1313
"ip" : "127.0.0.1",
14-
"version" : "5.5.1",
14+
"version" : "6.8.10",
1515
"build_hash" : "19c13d0",
1616
"roles" : [
1717
"master"
@@ -29,7 +29,7 @@
2929
"transport_address" : "http://localhost:9201",
3030
"host" : "localhost",
3131
"ip" : "127.0.0.1",
32-
"version" : "5.5.1",
32+
"version" : "6.8.10",
3333
"build_hash" : "19c13d0",
3434
"roles" : [
3535
"data"
@@ -47,7 +47,7 @@
4747
"transport_address" : "http://localhost:9202",
4848
"host" : "localhost",
4949
"ip" : "127.0.0.1",
50-
"version" : "5.5.1",
50+
"version" : "6.8.10",
5151
"build_hash" : "19c13d0",
5252
"roles" : [
5353
"data",
@@ -66,7 +66,7 @@
6666
"transport_address" : "http://localhost:9203",
6767
"host" : "localhost",
6868
"ip" : "127.0.0.1",
69-
"version" : "5.5.1",
69+
"version" : "6.8.10",
7070
"build_hash" : "19c13d0",
7171
"roles" : [ ],
7272
"http" : {
@@ -78,4 +78,4 @@
7878
}
7979
}
8080
}
81-
}
81+
}

spec/fixtures/scripts/groovy/scripted_update.groovy

Lines changed: 0 additions & 2 deletions
This file was deleted.

spec/fixtures/scripts/groovy/scripted_update_nested.groovy

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)