-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Enable lazy certificates for Elasticsearch #7991
Merged
eddumelendez
merged 10 commits into
testcontainers:main
from
pioorg:elasticsearch-lazy-certificates
Mar 4, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a56cd9a
Added note about node.js being required for ./gradlew spotlessApply
pioorg 3dc195a
Merge branch 'testcontainers:main' into main
pioorg 8f7f56c
Make fetching CA cert bytes in ElasticsearchContainer a lazy operation.
pioorg f777482
Make fetching CA cert bytes in ElasticsearchContainer a lazy operation.
pioorg e1d7393
Removed containerIsStarted from ElasticsearchContainer
pioorg 40c56ea
Moved setting certificate path to the constructor only for versions w…
pioorg 4bd207f
Merge branch 'main' into elasticsearch-lazy-certificates
pioorg af25467
Merge branch 'main' into elasticsearch-lazy-certificates
eddumelendez 4cd2802
Fix format
eddumelendez 4227f09
Apply suggestions from code review
eddumelendez 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 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 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 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
Oops, something went wrong.
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.
I think this will never be executed because
certPath
has a default value.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.
Hmmm... What if one calls
withCertPath("")
when creating the container?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.
Do you see any real use case when using
ElasticsearchContainer
and usewithCertPath("")
? If so, better to add a test to cover the scenario and also serve as a documentation. WDYT?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.
Thank you very much for this comment @eddumelendez, it made me think ;-)
And as the result of this process I suggest yet another small change, basically the constructor of the
ElasticsearchContainer
should set thecertPath
by default only for versions, which do that by default, that is 8.Previously it set it also for 7, which (after consideration) isn't optimal IMHO. I think, if version 7 requires manual opt-in to enable certificates, then this should be reflected in calling
withCertPath(thePath)
. No opt in -> no path for 7.Similarly for version 8, which has the certs enabled by default. If the user decides to disable them, ideally they should also state this intent by calling
withCertPath("")
.