Skip to content
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

Dev Services - Mark configured images as compatible with default ones #28198

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Sep 26, 2022

Fixes #27862

@quarkus-bot
Copy link

quarkus-bot bot commented Sep 26, 2022

/cc @loicmathieu, @yrodiere

Copy link
Member

@yrodiere yrodiere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, at least for the Elasticsearch part, though I have a few additional suggestions.

Also, it's missing the hardest part: tests. They were the reason I didn't take 2 minutes to tackle this in the first place: it'll take way more than 2 minutes downloading the various images :)

@@ -197,7 +197,7 @@ private DevServicesResultBuildItem.RunningDevService startElasticsearch(
// Starting the server
final Supplier<DevServicesResultBuildItem.RunningDevService> defaultElasticsearchSupplier = () -> {
ElasticsearchContainer container = new ElasticsearchContainer(
DockerImageName.parse(config.imageName));
DockerImageName.parse(config.imageName).asCompatibleSubstituteFor("elasticsearch/elasticsearch"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably also need elasticsearch here (or is it _/elasticsearch? I mean the one with no prefix, see https://hub.docker.com/_/elasticsearch/ vs. https://hub.docker.com/elastic/elasticsearch/).

Ideally we'd also allow OpenSearch, since our stack is compatible with it (except for the high-level client, maybe). But that may be a bit more adventurous. Relevant images:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not so sure. The whole purpose of it is to have ElasticsearchContainer to not complain about the custom image. And it is actually just checking that it's compatible with the default one.

We just want to pass:
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME, DEFAULT_OSS_IMAGE_NAME);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, well if you think that's enough I'll trust you.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That worked for me:
DockerImageName.parse(config.imageName).asCompatibleSubstituteFor("docker.elastic.co/elasticsearch/elasticsearch"));
Just My 2 Cents.

@yrodiere
Copy link
Member

Also, did you check that docker.elastic.co/elasticsearch/elasticsearch is accepted with that configuration? I'm not sure how the check works exactly...

@gsmet
Copy link
Member Author

gsmet commented Sep 26, 2022

I wanted to run our tests but they are not using dev services so I went with the quickstart and it worked so I think we are safe.

@yrodiere yrodiere merged commit 5cf63af into quarkusio:main Sep 27, 2022
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Sep 27, 2022
@gsmet gsmet modified the milestones: 2.14 - main, 2.13.1.Final Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ElasticSearch Dev Service image cannot be replaced with custom-built image
3 participants