Skip to content

Commit

Permalink
Have to ask around
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Crawford <steecraw@amazon.com>
  • Loading branch information
scrawfor99 committed Jul 27, 2023
1 parent 485ea16 commit b47521c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class OpenSearchCluster implements TestClusterConfiguration, Named {
private final FileSystemOperations fileSystemOperations;
private final ArchiveOperations archiveOperations;
private int nodeIndex = 0;

private String httpProtocol = "http";
private int zoneCount = 1;

public OpenSearchCluster(
Expand All @@ -100,7 +100,6 @@ public OpenSearchCluster(
this.archiveOperations = archiveOperations;
this.workingDirBase = workingDirBase;
this.nodes = project.container(OpenSearchNode.class);

// Always add the first node
String zone = hasZoneProperty() ? "zone-1" : "";
addNode(clusterName + "-0", zone);
Expand All @@ -117,6 +116,10 @@ public void setNumberOfZones(int zoneCount) {
this.zoneCount = zoneCount;
}

public void setHttpProtocol(String httpProtocol) {
this.httpProtocol = httpProtocol;
}

public void setNumberOfNodes(int numberOfNodes) {
checkFrozen();

Expand Down Expand Up @@ -163,7 +166,8 @@ private void addNode(String nodeName, String zoneName) {
fileSystemOperations,
archiveOperations,
workingDirBase,
zoneName
zoneName,
httpProtocol
);
// configure the cluster name eagerly
newNode.defaultConfig.put("cluster.name", safeName(clusterName));
Expand Down Expand Up @@ -559,7 +563,11 @@ public OpenSearchNode singleNode() {
private void addWaitForClusterHealth() {
waitConditions.put("cluster health yellow", (node) -> {
try {
WaitForHttpResource wait = new WaitForHttpResource("http", getFirstNode().getHttpSocketURI(), nodes.size());
WaitForHttpResource wait = new WaitForHttpResource(
getFirstNode().getHttpProtocol(),
getFirstNode().getHttpSocketURI(),
nodes.size()
);

List<Map<String, String>> credentials = getFirstNode().getCredentials();
if (getFirstNode().getCredentials().isEmpty() == false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ public class OpenSearchNode implements TestClusterConfiguration {
private static final TimeUnit NODE_UP_TIMEOUT_UNIT = TimeUnit.MINUTES;
private static final int ADDITIONAL_CONFIG_TIMEOUT = 15;
private static final TimeUnit ADDITIONAL_CONFIG_TIMEOUT_UNIT = TimeUnit.SECONDS;
private static final List<String> OVERRIDABLE_SETTINGS = Arrays.asList("path.repo", "discovery.seed_providers", "discovery.seed_hosts", "httpProtocol");
private static final List<String> OVERRIDABLE_SETTINGS = Arrays.asList(
"path.repo",
"discovery.seed_providers",
"discovery.seed_hosts",
"httpProtocol"
);

private static final int TAIL_LOG_MESSAGES_COUNT = 40;
private static final List<String> MESSAGES_WE_DONT_CARE_ABOUT = Arrays.asList(
Expand Down Expand Up @@ -160,7 +165,7 @@ public class OpenSearchNode implements TestClusterConfiguration {
private final Path httpPortsFile;
private final Path tmpDir;

private final String httpProtocol = "http";
private String httpProtocol = "http";
private int currentDistro = 0;
private TestDistribution testDistribution;
private final List<OpenSearchDistribution> distributions = new ArrayList<>();
Expand All @@ -187,7 +192,8 @@ public class OpenSearchNode implements TestClusterConfiguration {
FileSystemOperations fileSystemOperations,
ArchiveOperations archiveOperations,
File workingDirBase,
String zone
String zone,
String httpProtocol
) {
this.path = path;
this.name = name;
Expand All @@ -210,6 +216,7 @@ public class OpenSearchNode implements TestClusterConfiguration {
setTestDistribution(TestDistribution.INTEG_TEST);
setVersion(VersionProperties.getOpenSearch());
this.zone = zone;
this.httpProtocol = httpProtocol;
}

@Input
Expand Down

0 comments on commit b47521c

Please sign in to comment.