X Tutup
Skip to content

Introduce extrahosts parameter for building an image#1340

Merged
KostyaSha merged 2 commits intodocker-java:masterfrom
bmuschko:bm/build-image-extrahosts
Mar 7, 2020
Merged

Introduce extrahosts parameter for building an image#1340
KostyaSha merged 2 commits intodocker-java:masterfrom
bmuschko:bm/build-image-extrahosts

Conversation

@bmuschko
Copy link
Copy Markdown
Contributor

@bmuschko bmuschko commented Mar 5, 2020

For more information, see #1339.


This change is Reviewable

if (this.extraHosts == null) {
this.extraHosts = new HashSet<>();
}
this.extraHosts.add(extraHost);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

set instead add?

Copy link
Copy Markdown
Contributor Author

@bmuschko bmuschko Mar 6, 2020

Choose a reason for hiding this comment

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

The method parameter extraHost is of type String we will want to add to a Set of Strings. Can you elaborate? I don't think I understand your comment.

Copy link
Copy Markdown
Member

@KostyaSha KostyaSha Mar 7, 2020

Choose a reason for hiding this comment

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

It would be good to keep transparent with as setter withExtraHosts(Set<String>), better add additional method addExtraHost(String) if it really needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I orientated myself on this method for buildArgs: https://github.com/docker-java/docker-java/blob/master/docker-java-api/src/main/java/com/github/dockerjava/api/command/BuildImageCmd.java#L193. Granted, it's a Map but that doesn't really matter too much. Would you be opposed with keeping the method I introduced and then add another one for providing a Set?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Never mind, misread your comment. Will make that change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made the change. Decided to only expose a method for a Set<String>.

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #1340 into master will increase coverage by 34.4%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1340      +/-   ##
==========================================
+ Coverage   59.34%   93.75%   +34.4%     
==========================================
  Files         441        1     -440     
  Lines        8692       16    -8676     
  Branches      528        0     -528     
==========================================
- Hits         5158       15    -5143     
+ Misses       3246        1    -3245     
+ Partials      288        0     -288
Impacted Files Coverage Δ
.../dockerjava/api/model/ContainerSpecPrivileges.java
...ockerjava/core/command/RemoveSwarmNodeCmdImpl.java
...ithub/dockerjava/netty/NettyInvocationBuilder.java
...va/com/github/dockerjava/core/GoLangFileMatch.java
...a/com/github/dockerjava/api/model/BindOptions.java
.../github/dockerjava/api/model/PullResponseItem.java
...om/github/dockerjava/core/command/PingCmdImpl.java
...ub/dockerjava/core/command/CreateImageCmdImpl.java
.../github/dockerjava/jaxrs/KillContainerCmdExec.java
.../dockerjava/api/command/CreateNetworkResponse.java
... and 432 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 906e1a2...e38bbd8. Read the comment docs.

@KostyaSha KostyaSha added this to the 3.2.0-rc6 milestone Mar 7, 2020
@KostyaSha KostyaSha merged commit fe0ce66 into docker-java:master Mar 7, 2020
@bmuschko bmuschko deleted the bm/build-image-extrahosts branch March 8, 2020 00:58
@bmuschko
Copy link
Copy Markdown
Contributor Author

bmuschko commented Mar 8, 2020

Thanks for merging and releasing!

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.

3 participants

X Tutup