-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add DefaultDockerClientConfig.Builder#isDockerHostSetExplicitly
#1692
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
Merged
bsideup
merged 9 commits into
docker-java:master
from
kiview:docker-host-modified-getter
Aug 23, 2021
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
28323ad
Add getter for checking if dockerHost in DefaultDockerClientConfig.Bu…
kiview 0aed76a
Report as not-implicit even if default value was applied by user
kiview 317351d
Invert logo to `isDockerHostSetExplicit()`
kiview fa21e02
Refactor and simplify
kiview 8888cb5
Minimize changeset
kiview 2541d31
Only use DOCKER_HOST from Properties if not null
kiview 41180ba
Minimize diff
kiview df92cb5
Better grammar
kiview b20fb37
Update DefaultDockerClientConfigTest.java
bsideup 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
Next
Next commit
Add getter for checking if dockerHost in DefaultDockerClientConfig.Bu…
…ilder has default value
- Loading branch information
commit 28323adee5ebc9f79e0cedf984123eb878b9e614
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
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.
let's change it to
isDockerHostSetExplicitly(), to detect user's intention to override it (even if set to the 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.
Alright, will invert the logic (changed it to
usesImplicitDockerHost()before).As you can see, the checks are all over the place in
DefaultDockerClientConfignow, I lack the idea of a clean way to capture all places atm.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.
Have you considered removing
docker.hostfromDEFAULT_PROPERTIES, usingdockerHost != nullto detect explicit value, and then passingdockerHost != null ? dockerHost : DEFAULT_DOCKER_HOSTtoDefaultDockerClientConfigfrombuild()?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.
would work nicely if
dockerHostcould benullinBuilder😐But I will check further in this in this direction.
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.
why can't it be? :)
Uh oh!
There was an error while loading. Please reload this page.
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.
It can now. However, it changes the contract of
Builder.withDockerHost(), meaning it will only do parsing of host URI onbuild().I would consider this an acceptable tradeoff for the dramatically simplified changeset.
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 we can keep the validation, and call it from
withPropertiesonly if the value is not nullThere 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.
Yep, works nicely.