Skip to content

Commit

Permalink
Remove unused GRAYLOG_DATANODE_ROOT_PASSWORD_SHA2 from datanode conta…
Browse files Browse the repository at this point in the history
…iners (#20724)

* Remove unused GRAYLOG_DATANODE_ROOT_PASSWORD_SHA2 from datanode containers

* Remove rootPasswordSha2 from datanode container builders
  • Loading branch information
todvora authored Nov 7, 2024
1 parent 6aea00a commit 13162e4
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> featureFlags, Map<String, String> env) {
public DatanodeDevInstance(final SearchVersion version, final String hostname, final Network network, final String mongoDBUri, final String passwordSecret, final String heapSize, final List<String> featureFlags, Map<String, String> env) {
super(version, hostname, network, heapSize, featureFlags, env);
this.mongoDBUri = mongoDBUri;
this.passwordSecret = passwordSecret;
this.rootPasswordSha2 = rootPasswordSha2;
}

@Override
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 13162e4

Please sign in to comment.