From c517ec8b348f79ca92bc38d37131dc02f09f20b8 Mon Sep 17 00:00:00 2001 From: Tim Brooks Date: Thu, 4 Apr 2019 16:51:54 -0600 Subject: [PATCH] Remove string usages of old transport settings (#40818) This is related to #36652. We intend to deprecate a number of transport settings in 7.x and remove them in 8.0. This commit removes the string usages of these settings. --- .../elasticsearch/gradle/test/ClusterFormationTasks.groovy | 6 +++++- .../gradle/testclusters/ElasticsearchNode.java | 6 +++++- .../discovery/single/SingleNodeDiscoveryIT.java | 2 +- .../vagrant/src/test/resources/packaging/tests/certgen.bash | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 05333e47740cc..824cb161a63a0 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -412,7 +412,11 @@ class ClusterFormationTasks { } esConfig['node.max_local_storage_nodes'] = node.config.numNodes esConfig['http.port'] = node.config.httpPort - esConfig['transport.tcp.port'] = node.config.transportPort + if (node.nodeVersion.onOrAfter('6.7.0')) { + esConfig['transport.port'] = node.config.transportPort + } else { + esConfig['transport.tcp.port'] = node.config.transportPort + } // Default the watermarks to absurdly low to prevent the tests from failing on nodes without enough disk space esConfig['cluster.routing.allocation.disk.watermark.low'] = '1b' esConfig['cluster.routing.allocation.disk.watermark.high'] = '1b' diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index 337a9bdeac774..5a3e0d599f173 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -605,7 +605,11 @@ private void createConfiguration() { defaultConfig.put("node.attr.testattr", "test"); defaultConfig.put("node.portsfile", "true"); defaultConfig.put("http.port", "0"); - defaultConfig.put("transport.tcp.port", "0"); + if (Version.fromString(version).onOrAfter(Version.fromString("6.7.0"))) { + defaultConfig.put("transport.port", "0"); + } else { + defaultConfig.put("transport.tcp.port", "0"); + } // Default the watermarks to absurdly low to prevent the tests from failing on nodes without enough disk space defaultConfig.put("cluster.routing.allocation.disk.watermark.low", "1b"); defaultConfig.put("cluster.routing.allocation.disk.watermark.high", "1b"); diff --git a/server/src/test/java/org/elasticsearch/discovery/single/SingleNodeDiscoveryIT.java b/server/src/test/java/org/elasticsearch/discovery/single/SingleNodeDiscoveryIT.java index c3cae8f10ffce..5d8e3407e1811 100644 --- a/server/src/test/java/org/elasticsearch/discovery/single/SingleNodeDiscoveryIT.java +++ b/server/src/test/java/org/elasticsearch/discovery/single/SingleNodeDiscoveryIT.java @@ -59,7 +59,7 @@ protected Settings nodeSettings(int nodeOrdinal) { .builder() .put(super.nodeSettings(nodeOrdinal)) .put("discovery.type", "single-node") - .put("transport.tcp.port", "0") + .put("transport.port", "0") .build(); } diff --git a/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash b/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash index c0ae9aac4db30..13aed28b4c1ba 100644 --- a/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash +++ b/x-pack/qa/vagrant/src/test/resources/packaging/tests/certgen.bash @@ -259,7 +259,7 @@ xpack.security.http.ssl.certificate: $ESCONFIG/certs/node-master/node-master.crt xpack.security.http.ssl.certificate_authorities: ["$ESCONFIG/certs/ca/ca.crt"] xpack.security.transport.ssl.enabled: true -transport.tcp.port: 9300 +transport.port: 9300 xpack.security.http.ssl.enabled: true http.port: 9200