From 13162e47bee463b80b8f5a8bc3b246a65670a2fc Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Thu, 7 Nov 2024 17:29:52 +0100 Subject: [PATCH] Remove unused GRAYLOG_DATANODE_ROOT_PASSWORD_SHA2 from datanode containers (#20724) * Remove unused GRAYLOG_DATANODE_ROOT_PASSWORD_SHA2 from datanode containers * Remove rootPasswordSha2 from datanode container builders --- .../datanode/testinfra/DatanodeContainerizedBackend.java | 1 - .../datanode/testinfra/DatanodeDevContainerBuilder.java | 8 -------- .../storage/opensearch2/testing/DatanodeDevInstance.java | 5 +---- .../opensearch2/testing/DatanodeDevInstanceBuilder.java | 2 +- .../storage/opensearch2/testing/DatanodeInstance.java | 2 +- .../testing/datanode/DatanodeDevContainerBuilder.java | 1 - 6 files changed, 3 insertions(+), 16 deletions(-) diff --git a/data-node/src/test/java/org/graylog/datanode/testinfra/DatanodeContainerizedBackend.java b/data-node/src/test/java/org/graylog/datanode/testinfra/DatanodeContainerizedBackend.java index b0b83f4447cb..4a37686ca304 100644 --- a/data-node/src/test/java/org/graylog/datanode/testinfra/DatanodeContainerizedBackend.java +++ b/data-node/src/test/java/org/graylog/datanode/testinfra/DatanodeContainerizedBackend.java @@ -89,7 +89,6 @@ private GenericContainer createDatanodeContainer(String nodeName, DatanodeDoc .nodeName(nodeName) .network(network) .passwordSecret(ContainerizedGraylogBackend.PASSWORD_SECRET) - .rootPasswordSha2(ContainerizedGraylogBackend.ROOT_PASSWORD_SHA_2) .customizer(customizer) .build(); } diff --git a/data-node/src/test/java/org/graylog/datanode/testinfra/DatanodeDevContainerBuilder.java b/data-node/src/test/java/org/graylog/datanode/testinfra/DatanodeDevContainerBuilder.java index d6edf6a87fd7..af44118d184b 100644 --- a/data-node/src/test/java/org/graylog/datanode/testinfra/DatanodeDevContainerBuilder.java +++ b/data-node/src/test/java/org/graylog/datanode/testinfra/DatanodeDevContainerBuilder.java @@ -48,7 +48,6 @@ public class DatanodeDevContainerBuilder implements org.graylog.testing.datanode private String rootUsername = "admin"; private String passwordSecret; - private String rootPasswordSha2; private String mongoDbUri; private int restPort = 8999; private int openSearchHttpPort = 9200; @@ -74,12 +73,6 @@ public org.graylog.testing.datanode.DatanodeDevContainerBuilder passwordSecret(f return this; } - @Override - public org.graylog.testing.datanode.DatanodeDevContainerBuilder rootPasswordSha2(final String rootPasswordSha2) { - this.rootPasswordSha2 = rootPasswordSha2; - return this; - } - @Override public org.graylog.testing.datanode.DatanodeDevContainerBuilder rootUsername(final String rootUsername) { this.rootUsername = rootUsername; @@ -169,7 +162,6 @@ public GenericContainer build() { .withEnv("GRAYLOG_DATANODE_ROOT_USERNAME", rootUsername) .withEnv("GRAYLOG_DATANODE_PASSWORD_SECRET", passwordSecret) - .withEnv("GRAYLOG_DATANODE_ROOT_PASSWORD_SHA2", rootPasswordSha2) .withEnv("GRAYLOG_DATANODE_NODE_ID_FILE", "./node-id") .withEnv("GRAYLOG_DATANODE_HTTP_BIND_ADDRESS", "0.0.0.0:" + restPort) diff --git a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeDevInstance.java b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeDevInstance.java index dd68b5b387af..e595c1558749 100644 --- a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeDevInstance.java +++ b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeDevInstance.java @@ -33,13 +33,11 @@ public class DatanodeDevInstance extends OpenSearchInstance { public static final SearchServer DATANODE_VERSION = SearchServer.DATANODE_DEV; private final String mongoDBUri; private final String passwordSecret; - private final String rootPasswordSha2; - public DatanodeDevInstance(final SearchVersion version, final String hostname, final Network network, final String mongoDBUri, final String passwordSecret, final String rootPasswordSha2, final String heapSize, final List featureFlags, Map env) { + public DatanodeDevInstance(final SearchVersion version, final String hostname, final Network network, final String mongoDBUri, final String passwordSecret, final String heapSize, final List featureFlags, Map env) { super(version, hostname, network, heapSize, featureFlags, env); this.mongoDBUri = mongoDBUri; this.passwordSecret = passwordSecret; - this.rootPasswordSha2 = rootPasswordSha2; } @Override @@ -65,7 +63,6 @@ public GenericContainer buildContainer(String image, Network network) { return builder .nodeName(hostname) .passwordSecret(passwordSecret) - .rootPasswordSha2(rootPasswordSha2) .network(network) .mongoDbUri(mongoDBUri) .restPort(8999) diff --git a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeDevInstanceBuilder.java b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeDevInstanceBuilder.java index 0e810166587a..884cc3fa6e76 100644 --- a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeDevInstanceBuilder.java +++ b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeDevInstanceBuilder.java @@ -26,6 +26,6 @@ public DatanodeDevInstanceBuilder(SearchVersion version) { @Override protected DatanodeDevInstance instantiate() { - return new DatanodeDevInstance(getVersion(), getHostname(), getNetwork(), getMongoDbUri(), getPasswordSecret(), getRootPasswordSha2(), getHeapSize(), getFeatureFlags(), getEnv()).init(); + return new DatanodeDevInstance(getVersion(), getHostname(), getNetwork(), getMongoDbUri(), getPasswordSecret(), getHeapSize(), getFeatureFlags(), getEnv()).init(); } } diff --git a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeInstance.java b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeInstance.java index 9c1540937e9d..c3f6b5957847 100644 --- a/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeInstance.java +++ b/graylog-storage-opensearch2/src/test/java/org/graylog/storage/opensearch2/testing/DatanodeInstance.java @@ -69,7 +69,7 @@ public GenericContainer buildContainer(String image, Network network) { .withReuse(isNull(System.getenv("CI"))) .withEnv("OPENSEARCH_JAVA_OPTS", getEsJavaOpts()) .withEnv("GRAYLOG_DATANODE_PASSWORD_SECRET", passwordSecret) - .withEnv("GRAYLOG_DATANODE_ROOT_PASSWORD_SHA2", rootPasswordSha2) + //.withEnv("GRAYLOG_DATANODE_ROOT_PASSWORD_SHA2", rootPasswordSha2) .withEnv("GRAYLOG_DATANODE_MONGODB_URI", mongoDBUri) .withEnv("GRAYLOG_DATANODE_SINGLE_NODE_ONLY", "true") .withEnv("GRAYLOG_DATANODE_INSECURE_STARTUP", "true") diff --git a/graylog2-server/src/test/java/org/graylog/testing/datanode/DatanodeDevContainerBuilder.java b/graylog2-server/src/test/java/org/graylog/testing/datanode/DatanodeDevContainerBuilder.java index b740317d0165..3af568c0db97 100644 --- a/graylog2-server/src/test/java/org/graylog/testing/datanode/DatanodeDevContainerBuilder.java +++ b/graylog2-server/src/test/java/org/graylog/testing/datanode/DatanodeDevContainerBuilder.java @@ -26,7 +26,6 @@ public interface DatanodeDevContainerBuilder { DatanodeDevContainerBuilder mongoDbUri(final String mongoDbUri); DatanodeDevContainerBuilder passwordSecret(final String passwordSecret); - DatanodeDevContainerBuilder rootPasswordSha2(final String rootPasswordSha2); DatanodeDevContainerBuilder rootUsername(String rootUsername);