-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Rename Docker image name and make it public #3350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,18 +23,13 @@ | |
| import org.elasticsearch.transport.client.PreBuiltTransportClient; | ||
| import org.junit.After; | ||
| import org.junit.Test; | ||
| import org.testcontainers.utility.DockerImageName; | ||
|
|
||
| public class ElasticsearchContainerTest { | ||
|
|
||
| /** | ||
| * Elasticsearch version which should be used for the Tests | ||
| */ | ||
| private static final String ELASTICSEARCH_VERSION = "7.9.2"; | ||
| private static final DockerImageName ELASTICSEARCH_IMAGE = | ||
| DockerImageName | ||
| .parse("docker.elastic.co/elasticsearch/elasticsearch") | ||
| .withTag(ELASTICSEARCH_VERSION); | ||
|
|
||
| /** | ||
| * Elasticsearch default username, when secured | ||
|
|
@@ -61,7 +56,6 @@ public void stopRestClient() throws IOException { | |
| } | ||
| } | ||
|
|
||
| @SuppressWarnings("deprecation") // Using deprecated constructor for verification of backwards compatibility | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that this change is not related to the goal of this PR and is a leftover from #2320 |
||
| @Test | ||
| @Deprecated // We will remove this test in the future | ||
| public void elasticsearchDeprecatedCtorTest() throws IOException { | ||
|
|
@@ -88,7 +82,9 @@ public void elasticsearchDeprecatedCtorTest() throws IOException { | |
| @Test | ||
| public void elasticsearchDefaultTest() throws IOException { | ||
| // Create the elasticsearch container. | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer(ELASTICSEARCH_IMAGE) | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer( | ||
| ElasticsearchContainer.ELASTICSEARCH_IMAGE | ||
| .withTag(ELASTICSEARCH_VERSION)) | ||
| .withEnv("foo", "bar") // dummy env for compiler checking correct generics usage | ||
| ) { | ||
| // Start the container. This step might take some time... | ||
|
|
@@ -109,7 +105,9 @@ public void elasticsearchDefaultTest() throws IOException { | |
|
|
||
| @Test | ||
| public void elasticsearchSecuredTest() throws IOException { | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer(ELASTICSEARCH_IMAGE) | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer( | ||
| ElasticsearchContainer.ELASTICSEARCH_IMAGE | ||
| .withTag(ELASTICSEARCH_VERSION)) | ||
| .withPassword(ELASTICSEARCH_PASSWORD)) { | ||
| container.start(); | ||
|
|
||
|
|
@@ -127,7 +125,10 @@ public void elasticsearchSecuredTest() throws IOException { | |
|
|
||
| @Test | ||
| public void elasticsearchVersion() throws IOException { | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer(ELASTICSEARCH_IMAGE)) { | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer( | ||
| ElasticsearchContainer.ELASTICSEARCH_IMAGE | ||
| .withTag(ELASTICSEARCH_VERSION) | ||
| )) { | ||
| container.start(); | ||
| Response response = getClient(container).performRequest(new Request("GET", "/")); | ||
| assertThat(response.getStatusLine().getStatusCode(), is(200)); | ||
|
|
@@ -141,8 +142,7 @@ public void elasticsearchOssImage() throws IOException { | |
| try (ElasticsearchContainer container = | ||
| // ossContainer { | ||
| new ElasticsearchContainer( | ||
| DockerImageName | ||
| .parse("docker.elastic.co/elasticsearch/elasticsearch-oss") | ||
| ElasticsearchContainer.ELASTICSEARCH_OSS_IMAGE | ||
| .withTag(ELASTICSEARCH_VERSION) | ||
| ) | ||
| // } | ||
|
|
@@ -161,7 +161,10 @@ public void elasticsearchOssImage() throws IOException { | |
| public void restClientClusterHealth() throws IOException { | ||
| // httpClientContainer { | ||
| // Create the elasticsearch container. | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer(ELASTICSEARCH_IMAGE)) { | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer( | ||
| ElasticsearchContainer.ELASTICSEARCH_IMAGE | ||
| .withTag(ELASTICSEARCH_VERSION) | ||
| )) { | ||
| // Start the container. This step might take some time... | ||
| container.start(); | ||
|
|
||
|
|
@@ -187,7 +190,9 @@ public void restClientClusterHealth() throws IOException { | |
| public void restClientSecuredClusterHealth() throws IOException { | ||
| // httpClientSecuredContainer { | ||
| // Create the elasticsearch container. | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer(ELASTICSEARCH_IMAGE) | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer( | ||
| ElasticsearchContainer.ELASTICSEARCH_IMAGE | ||
| .withTag(ELASTICSEARCH_VERSION)) | ||
| // With a password | ||
| .withPassword(ELASTICSEARCH_PASSWORD)) { | ||
| // Start the container. This step might take some time... | ||
|
|
@@ -216,7 +221,9 @@ public void restClientSecuredClusterHealth() throws IOException { | |
| public void transportClientClusterHealth() { | ||
| // transportClientContainer { | ||
| // Create the elasticsearch container. | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer(ELASTICSEARCH_IMAGE)){ | ||
| try (ElasticsearchContainer container = new ElasticsearchContainer( | ||
| ElasticsearchContainer.ELASTICSEARCH_IMAGE | ||
| .withTag(ELASTICSEARCH_VERSION))) { | ||
| // Start the container. This step might take some time... | ||
| container.start(); | ||
|
|
||
|
|
@@ -242,8 +249,7 @@ public void incompatibleSettingsTest() { | |
| assertThrows("We should not be able to activate security with an OSS License", | ||
| IllegalArgumentException.class, | ||
| () -> new ElasticsearchContainer( | ||
| DockerImageName | ||
| .parse("docker.elastic.co/elasticsearch/elasticsearch-oss") | ||
| ElasticsearchContainer.ELASTICSEARCH_OSS_IMAGE | ||
| .withTag(ELASTICSEARCH_VERSION)) | ||
| .withPassword("foo") | ||
| ); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This image has been removed after 7.10.2. So I believe that I should update the PR and remove entirely this field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't images distributed over Docker Hub again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. There's no -oss package after 7.10.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there's the default distribution as it has always been 😊