diff --git a/rest-api-spec/build.gradle b/rest-api-spec/build.gradle index d9c0ab5294906..cf40c786db17b 100644 --- a/rest-api-spec/build.gradle +++ b/rest-api-spec/build.gradle @@ -218,6 +218,12 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task -> // we can now search using doc values only task.replaceValueInMatch("fields.object\\.nested1.long.searchable", true) + + //client.type no longer exists #101214 + task.replaceKeyInMatch("nodes.\$node_id.settings.client.type", "nodes.\$node_id.settings.node.attr.testattr") + task.replaceValueInMatch("nodes.\$node_id.settings.node.attr.testattr", "test") + task.replaceKeyInMatch("nodes.\$node_id.settings.client\\.type", "nodes.\$node_id.settings.node\\.attr\\.testattr") + task.replaceValueInMatch("nodes.\$node_id.settings.node\\.attr\\.testattr", "test") } tasks.register('enforceYamlTestConvention').configure { diff --git a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/30_settings.yml b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/30_settings.yml index 99b8b6f361a47..dc6062c6f282b 100644 --- a/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/30_settings.yml +++ b/rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/nodes.info/30_settings.yml @@ -12,11 +12,11 @@ nodes.info: metric: [ settings ] - - match : { nodes.$node_id.settings.client.type: node } + - match : { nodes.$node_id.settings.node.attr.testattr: test } - do: nodes.info: metric: [ settings ] flat_settings: true - - match : { nodes.$node_id.settings.client\.type: node } + - match : { nodes.$node_id.settings.node\.attr\.testattr: test } diff --git a/server/src/internalClusterTest/java/org/elasticsearch/client/internal/node/NodeClientIT.java b/server/src/internalClusterTest/java/org/elasticsearch/client/internal/node/NodeClientIT.java deleted file mode 100644 index c260b873d5ad9..0000000000000 --- a/server/src/internalClusterTest/java/org/elasticsearch/client/internal/node/NodeClientIT.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0 and the Server Side Public License, v 1; you may not use this file except - * in compliance with, at your election, the Elastic License 2.0 or the Server - * Side Public License, v 1. - */ -package org.elasticsearch.client.internal.node; - -import org.elasticsearch.client.internal.Client; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.test.ESIntegTestCase; -import org.elasticsearch.test.ESIntegTestCase.ClusterScope; -import org.elasticsearch.test.ESIntegTestCase.Scope; - -import static org.hamcrest.Matchers.is; - -@ClusterScope(scope = Scope.SUITE) -public class NodeClientIT extends ESIntegTestCase { - @Override - protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) { - return Settings.builder() - .put(super.nodeSettings(nodeOrdinal, otherSettings)) - .put(Client.CLIENT_TYPE_SETTING_S.getKey(), "anything") - .build(); - } - - public void testThatClientTypeSettingCannotBeChanged() { - for (Settings settings : internalCluster().getInstances(Settings.class)) { - assertThat(Client.CLIENT_TYPE_SETTING_S.get(settings), is("node")); - } - } -} diff --git a/server/src/main/java/org/elasticsearch/client/internal/Client.java b/server/src/main/java/org/elasticsearch/client/internal/Client.java index 1065efb857fe7..89cb764549767 100644 --- a/server/src/main/java/org/elasticsearch/client/internal/Client.java +++ b/server/src/main/java/org/elasticsearch/client/internal/Client.java @@ -73,6 +73,7 @@ */ public interface Client extends ElasticsearchClient, Releasable { + // Note: This setting is registered only for bwc. The value is never read. Setting CLIENT_TYPE_SETTING_S = new Setting<>("client.type", "node", (s) -> { return switch (s) { case "node", "transport" -> s; diff --git a/server/src/main/java/org/elasticsearch/node/NodeConstruction.java b/server/src/main/java/org/elasticsearch/node/NodeConstruction.java index 952130ecf6357..246a41c99c922 100644 --- a/server/src/main/java/org/elasticsearch/node/NodeConstruction.java +++ b/server/src/main/java/org/elasticsearch/node/NodeConstruction.java @@ -345,10 +345,7 @@ private void construct(Environment initialEnvironment, NodeServiceProvider servi throws IOException { // Pass the node settings to the DeprecationLogger class so that it can have the deprecation.skip_deprecated_settings setting: DeprecationLogger.initialize(initialEnvironment.settings()); - Settings environmentSettings = Settings.builder() - .put(initialEnvironment.settings()) - .put(Client.CLIENT_TYPE_SETTING_S.getKey(), "node") - .build(); + Settings environmentSettings = initialEnvironment.settings(); final JvmInfo jvmInfo = JvmInfo.jvmInfo(); logger.info( diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackPluginTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackPluginTests.java index 23633138d570d..4f15d719d4193 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackPluginTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackPluginTests.java @@ -8,7 +8,6 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.master.AcknowledgedResponse; -import org.elasticsearch.client.internal.Client; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.node.DiscoveryNodeUtils; @@ -74,9 +73,6 @@ public void setup() { public void testXPackInstalledAttrClash() throws Exception { Settings.Builder builder = Settings.builder(); builder.put("node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR, randomBoolean()); - if (randomBoolean()) { - builder.put(Client.CLIENT_TYPE_SETTING_S.getKey(), "transport"); - } XPackPlugin xpackPlugin = createXPackPlugin(builder.put("path.home", createTempDir()).build()); IllegalArgumentException e = expectThrows(IllegalArgumentException.class, xpackPlugin::additionalSettings); assertThat(