Skip to content

Commit c318932

Browse files
committed
[EXT] Updates in Cluster
1 parent 3d99b28 commit c318932

File tree

1 file changed

+9
-7
lines changed
  • elasticsearch-extensions/lib/elasticsearch/extensions/test

1 file changed

+9
-7
lines changed

elasticsearch-extensions/lib/elasticsearch/extensions/test/cluster.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def ansi(*args)
3838
module Elasticsearch
3939
module Extensions
4040
module Test
41-
4241
# A convenience Ruby class for starting and stopping an Elasticsearch cluster,
4342
# eg. for integration tests
4443
#
@@ -60,36 +59,35 @@ module Test
6059
# @see Cluster#initialize
6160
#
6261
module Cluster
63-
6462
# Starts a cluster
6563
#
6664
# @see Cluster#start
6765
#
68-
def start(arguments={})
66+
def start(arguments = {})
6967
Cluster.new(arguments).start
7068
end
7169

7270
# Stops a cluster
7371
#
7472
# @see Cluster#stop
7573
#
76-
def stop(arguments={})
74+
def stop(arguments = {})
7775
Cluster.new(arguments).stop
7876
end
7977

8078
# Returns true when a specific test node is running within the cluster
8179
#
8280
# @see Cluster#running?
8381
#
84-
def running?(arguments={})
82+
def running?(arguments = {})
8583
Cluster.new(arguments).running?
8684
end
8785

8886
# Waits until the cluster is green and prints information
8987
#
9088
# @see Cluster#wait_for_green
9189
#
92-
def wait_for_green(arguments={})
90+
def wait_for_green(arguments = {})
9391
Cluster.new(arguments).wait_for_green
9492
end
9593

@@ -215,6 +213,7 @@ class Cluster
215213
}
216214
}
217215
COMMANDS['7.0'] = COMMANDS['6.0'].clone
216+
COMMANDS['8.0'] = COMMANDS['7.0'].clone
218217
COMMANDS.freeze
219218

220219
# Create a new instance of the Cluster class
@@ -430,7 +429,7 @@ def __default_network_host
430429
'0.0.0.0'
431430
when /^2/
432431
'_local_'
433-
when /^5|^6|^7/
432+
when /^5|^6|^7|^8/
434433
'_local_'
435434
else
436435
raise RuntimeError, "Cannot determine default network host from version [#{version}]"
@@ -473,6 +472,7 @@ def __cluster_url
473472
#
474473
def __determine_version
475474
path_to_lib = File.dirname(arguments[:command]) + '/../lib/'
475+
476476
version = if arguments[:version]
477477
arguments[:version]
478478
elsif File.exist?(path_to_lib) && !(jar = Dir.entries(path_to_lib).select { |f| f =~ /^elasticsearch\-\d/ }.first).nil?
@@ -550,6 +550,8 @@ def __determine_version
550550
'6.0'
551551
when /^7\..*/
552552
'7.0'
553+
when /^8\..*/
554+
'8.0'
553555
else
554556
raise RuntimeError, "Cannot determine major version from [#{version}]"
555557
end

0 commit comments

Comments
 (0)