Skip to content

Commit

Permalink
Fix stragglers from renaming to OpenSearch work. (#483)
Browse files Browse the repository at this point in the history
This commit fixes more instances where we missed renaming to OpenSearch.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
  • Loading branch information
adnapibar authored Apr 5, 2021
1 parent 2477720 commit 2dca346
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 36 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ allprojects {
// other packages (e.g org.opensearch.client) will point to server rather than
// their own artifacts.
if (project.plugins.hasPlugin(BuildPlugin) || project.plugins.hasPlugin(PluginBuildPlugin)) {
String artifactsHost = VersionProperties.getOpenSearch().endsWith("-SNAPSHOT") ? "https://snapshots.elastic.co" : "https://artifacts.elastic.co"
String artifactsHost = VersionProperties.getOpenSearch().endsWith("-SNAPSHOT")
? "https://artifacts.opensearch.org/snapshots/"
: "https://artifacts.opensearch.org/releases/"
Closure sortClosure = { a, b -> b.group <=> a.group }
Closure depJavadocClosure = { shadowed, dep ->
if ((dep instanceof ProjectDependency) == false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ abstract class AbstractGradleFuncTest extends Specification {
void setupLocalGitRepo() {
//TODO: cleanup
execute("git init")
execute('git config user.email "build-tool@elastic.co"')
execute('git config user.email "build-tool@opensearch.org"')
execute('git config user.name "Build tool"')
execute("git add .")
execute('git commit -m "Initial"')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGradleFuncTest
fakeRemote.file + "/.git"
gradleRunner(workingRemoteGit, "wrapper").build()
execute("git init", workingRemoteGit)
execute('git config user.email "build-tool@elastic.co"', workingRemoteGit)
execute('git config user.email "build-tool@opensearch.org"', workingRemoteGit)
execute('git config user.name "Build tool"', workingRemoteGit)
execute("git add .", workingRemoteGit)
execute('git commit -m"Initial"', workingRemoteGit)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
then:
result.task(":distribution:bwc:minor:buildBwcExpandedTask").outcome == TaskOutcome.SUCCESS
result.task(":setupDistro").outcome == TaskOutcome.SUCCESS
assertExtractedDistroIsCreated("distribution/bwc/minor/build/install/elastic-distro",
assertExtractedDistroIsCreated("distribution/bwc/minor/build/install/opensearch-distro",
'bwc-marker.txt')
}

Expand Down Expand Up @@ -158,7 +158,7 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
configurations.create("expanded-oss-linux-tar")
def expandedTask = tasks.register("buildBwcExpandedTask", Copy) {
from('bwc-marker.txt')
into('build/install/elastic-distro')
into('build/install/opensearch-distro')
}
artifacts {
it.add("expanded-oss-linux-tar", file('build/install')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public void testCheckTask() {
}

public void testInsecureMavenRepository() throws IOException {
final String name = "elastic-maven";
final String url = "http://s3.amazonaws.com/artifacts.elastic.co/maven";
final String name = "opensearch-maven";
final String url = "http://s3.amazonaws.com/artifacts.opensearch.org/maven";
// add an insecure maven repository to the build.gradle
final List<String> lines = Arrays.asList(
"repositories {",
" maven {",
" name \"elastic-maven\"",
" name \"opensearch-maven\"",
" url \"" + url + "\"\n",
" }",
"}"
Expand All @@ -72,13 +72,13 @@ public void testInsecureMavenRepository() throws IOException {
}

public void testInsecureIvyRepository() throws IOException {
final String name = "elastic-ivy";
final String url = "http://s3.amazonaws.com/artifacts.elastic.co/ivy";
final String name = "opensearch-ivy";
final String url = "http://s3.amazonaws.com/artifacts.opensearch.org/ivy";
// add an insecure ivy repository to the build.gradle
final List<String> lines = Arrays.asList(
"repositories {",
" ivy {",
" name \"elastic-ivy\"",
" name \"opensearch-ivy\"",
" url \"" + url + "\"\n",
" }",
"}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ private static void setupDownloadServiceRepo(Project project) {
if (project.getRepositories().findByName(DOWNLOAD_REPO_NAME) != null) {
return;
}
addIvyRepo(project, DOWNLOAD_REPO_NAME, "https://artifacts-no-kpi.elastic.co", FAKE_IVY_GROUP);
addIvyRepo(project, SNAPSHOT_REPO_NAME, "https://snapshots-no-kpi.elastic.co", FAKE_SNAPSHOT_IVY_GROUP);
addIvyRepo(project, DOWNLOAD_REPO_NAME, "https://artifacts-no-kpi.opensearch.org", FAKE_IVY_GROUP);
addIvyRepo(project, SNAPSHOT_REPO_NAME, "https://snapshots-no-kpi.opensearch.org", FAKE_SNAPSHOT_IVY_GROUP);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void testParsingPublishAddressWithES7Format() throws IOException {
HttpEntity entity = new InputStreamEntity(in, ContentType.APPLICATION_JSON);
List<Node> nodes = OpenSearchNodesSniffer.readHosts(entity, Scheme.HTTP, new JsonFactory());

assertEquals("elastic.test", nodes.get(0).getHost().getHostName());
assertEquals("opensearch.test", nodes.get(0).getHost().getHostName());
assertEquals(9200, nodes.get(0).getHost().getPort());
assertEquals("http", nodes.get(0).getHost().getSchemeName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"attributes": { },
"http": {
"bound_address": [
"elastic.test:9200"
"opensearch.test:9200"
],
"publish_address": "elastic.test/127.0.0.1:9200",
"publish_address": "opensearch.test/127.0.0.1:9200",
"max_content_length_in_bytes": 104857600
}
}
Expand Down
2 changes: 1 addition & 1 deletion distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
* <dd>The default directory from which to load configuration. This is used in
* the packaging scripts, but in that context it is always
* /etc/opensearch. Its also used in bin/opensearch-plugin, where it is
* /etc/opensearch for the os packages but $OPENSEARCHHOME/config otherwise.</dd>
* /etc/opensearch for the os packages but $OPENSEARCH_HOME/config otherwise.</dd>
* <dt>path.env</dt>
* <dd>The env file sourced before bin/opensearch to set environment
* variables. Think /etc/defaults/opensearch.</dd>
Expand Down
2 changes: 1 addition & 1 deletion distribution/licenses/openjdk-NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Copyright (c) 1995, 2013, Oracle and/or its affiliates.

OpenJDK is licensed under the GPLv2+CE. A copy of that license is included in
this distribution immediately below this notice. You can find a copy of the
OpenJDK source through the downloads page at https://elastic.co.
OpenJDK source through the downloads page at https://opensearch.org.
1 change: 1 addition & 0 deletions distribution/packages/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ subprojects {
licenseFilename = "APACHE-LICENSE-2.0.txt"
final List<String> header = Arrays.asList("Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/",
"Copyright: Elasticsearch B.V. <info@elastic.co>",
"Copyright: OpenSearch Contributors",
"License: " + expectedLicense)
final List<String> licenseLines = Files.readAllLines(rootDir.toPath().resolve("licenses/" + licenseFilename))
final List<String> expectedLines = header + licenseLines.collect { " " + it }
Expand Down
1 change: 1 addition & 0 deletions distribution/packages/src/deb/copyright
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Copyright: Elasticsearch B.V. <info@elastic.co>
Copyright: OpenSearch Contributors
License: ${license.name}
${license.text}
3 changes: 0 additions & 3 deletions distribution/packages/src/deb/lintian/opensearch
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,3 @@ hardening-no-pie usr/share/opensearch/jdk/lib/*

# the system java version that lintian assumes is far behind what opensearch uses
unknown-java-class-version

# elastic licensed modules contain elastic license
extra-license-file usr/share/opensearch/modules/*
2 changes: 1 addition & 1 deletion distribution/src/bin/opensearch-env-from-file
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set -e -o pipefail
# This script is intended to be sourced, not executed, and modifies the
# environment.

for VAR_NAME_FILE in ELASTIC_PASSWORD_FILE KEYSTORE_PASSWORD_FILE ; do
for VAR_NAME_FILE in OPENSEARCH_PASSWORD_FILE KEYSTORE_PASSWORD_FILE ; do
if [[ -n "${!VAR_NAME_FILE}" ]]; then
VAR_NAME="${VAR_NAME_FILE%_FILE}"

Expand Down
2 changes: 1 addition & 1 deletion distribution/src/bin/opensearch-service.bat
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ if "%OPENSEARCH_START_TYPE%" == "" set OPENSEARCH_START_TYPE=manual
if "%OPENSEARCH_STOP_TIMEOUT%" == "" set OPENSEARCH_STOP_TIMEOUT=0

if "%SERVICE_DISPLAY_NAME%" == "" set SERVICE_DISPLAY_NAME=OpenSearch %OPENSEARCH_VERSION% (%SERVICE_ID%)
if "%SERVICE_DESCRIPTION%" == "" set SERVICE_DESCRIPTION=OpenSearch %OPENSEARCH_VERSION% Windows Service - https://elastic.co
if "%SERVICE_DESCRIPTION%" == "" set SERVICE_DESCRIPTION=OpenSearch %OPENSEARCH_VERSION% Windows Service - https://opensearch.org

if not "%SERVICE_USERNAME%" == "" (
if not "%SERVICE_PASSWORD%" == "" (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ teardown:
id: 1
pipeline: "1"
body: {
my_url: "https%3a%2f%2felastic.co%2f"
my_url: "https%3a%2f%2fopensearch.org%2f"
}

- do:
get:
index: test
id: 1
- match: { _source.my_url: "https://elastic.co/" }
- match: { _source.my_url: "https://opensearch.org/" }
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testExample() throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), StandardCharsets.UTF_8))
) {
writer.write("GET / HTTP/1.1\r\n");
writer.write("Host: elastic.co\r\n\r\n");
writer.write("Host: opensearch.org\r\n\r\n");
writer.flush();

final List<String> lines = new ArrayList<>();
Expand Down
12 changes: 6 additions & 6 deletions plugins/repository-hdfs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ dependencies {
// Set the keytab files in the classpath so that we can access them from test code without the security manager
// freaking out.
if (isEclipse == false) {
testRuntimeOnly files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab").parent)
testRuntimeOnly files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.opensearch.org.keytab").parent)
}
}

Expand Down Expand Up @@ -139,9 +139,9 @@ for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture',

// If it's a secure fixture, then set the principal name and keytab locations to use for auth.
if (fixtureName.equals('secureHdfsFixture') || fixtureName.equals('secureHaHdfsFixture')) {
miniHDFSArgs.add("hdfs/hdfs.build.elastic.co@${realm}")
miniHDFSArgs.add("hdfs/hdfs.build.opensearch.org@${realm}")
miniHDFSArgs.add(
project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab")
project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.opensearch.org.keytab")
)
}

Expand Down Expand Up @@ -201,12 +201,12 @@ for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSec

if (integTestTaskName.contains("Secure")) {
if (disabledIntegTestTaskNames.contains(integTestTaskName) == false) {
nonInputProperties.systemProperty "test.krb5.principal.es", "elasticsearch@${realm}"
nonInputProperties.systemProperty "test.krb5.principal.hdfs", "hdfs/hdfs.build.elastic.co@${realm}"
nonInputProperties.systemProperty "test.krb5.principal.es", "opensearch@${realm}"
nonInputProperties.systemProperty "test.krb5.principal.hdfs", "hdfs/hdfs.build.opensearch.org@${realm}"
jvmArgs "-Djava.security.krb5.conf=${krb5conf}"
nonInputProperties.systemProperty(
"test.krb5.keytab.hdfs",
project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab")
project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.opensearch.org.keytab")
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/krb5kdc-fixture/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ubuntu:14.04
ADD . /fixture
RUN echo kerberos.build.elastic.co > /etc/hostname && echo "127.0.0.1 kerberos.build.elastic.co" >> /etc/hosts
RUN echo kerberos.build.opensearch.org > /etc/hostname && echo "127.0.0.1 kerberos.build.opensearch.org" >> /etc/hosts
RUN bash /fixture/src/main/resources/provision/installkdc.sh

EXPOSE 88
EXPOSE 88/udp

CMD sleep infinity
CMD sleep infinity
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ cat << EOF > /etc/krb5kdc/kadm5.acl
EOF

# Create admin principal
kadmin.local -q "addprinc -pw elastic admin/admin@$REALM_NAME"
kadmin.local -q "addprinc -pw opensearch admin/admin@$REALM_NAME"
kadmin.local -q "ktadd -k /etc/admin.keytab admin/admin@$REALM_NAME"

# Create a link so addprinc.sh is on path
ln -s $PROV_DIR/addprinc.sh /usr/bin/
ln -s $PROV_DIR/addprinc.sh /usr/bin/

0 comments on commit 2dca346

Please sign in to comment.