Implementation of copy archive to/from container commands#347
Implementation of copy archive to/from container commands#347marcuslinke merged 15 commits intodocker-java:masterfrom vuminhkh:master
Conversation
Modification of Copy file from container command to follow 1.20 API
|
@vuminhkh Thanks for your contribution. I will merge ASAP. |
There was a problem hiding this comment.
Thank you. It's better to go with new Java 7 functionality. It's cleaner.
|
I see many unclosed streams, @vuminhkh could you check that you have no resource leaks https://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html ? |
|
Hello, For streams unclosed, if i'm not mistaken it's about the tar method in CompressArchiveUtil, as it's stream which wrap stream, closing the most outer will delegate to inner and the whole stream chain will be closed. For formatting rules, i'm using Intellij, please feel free to re-organize based on your IDE settings, or give me some hints to have the same format rules as yours. Thanks, Minh Khang VU |
* master: Update CHANGELOG.md issue #349
* master: (21 commits) Update CHANGELOG.md Format sources Update CHANGELOG.md Update CHANGELOG.md Added missing withXXX(List list) methods Update README.md Bump to version 3.0.0-SNAPSHOT according to semver Update CHANGELOG.md Added override for bulk-read variant of InputStream.read() in anonymous inner class created by Dockerfile.ScannedResult.buildDockerFolderTar(). This fixes an IO performance issue that occurs when only the single-byte variant of the read() method on InputStream is overriden. Added @checkfornull annotation Update README.md Update CHANGELOG.md [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release docker-java-2.1.2 Fix issue #348 Small doc fixes Removed import Added additional withX(List<Y> x) methods Added null check annotations and removed withX() methods WIP ... Conflicts: src/main/java/com/github/dockerjava/core/command/CopyFileFromContainerCmdImpl.java
|
@vuminhkh After thinking about again we should stay backward compatible. In fact the |
|
Hi Marcus, I'll find my-self some times to do this asap. Minh Khang VU |
* master: Fix DockerClientConfig serialization. Move findbugs into profile. Add checkstyle with unused imports check Move utils into util package Remove unused imports Make util contstructors private Move exceptions into separate package Conflicts: src/main/java/com/github/dockerjava/core/command/CopyFileFromContainerCmdImpl.java src/main/java/com/github/dockerjava/jaxrs/DockerCmdExecFactoryImpl.java
…hiveFromContainerCmd and CopyArchiveToContainerCmd
|
Hi Marcus, Please review to see if it's ok. There are always 8 test failures (the same as before) but they don't concern the commands that I added/modified. Regards, Minh Khang VU |
There was a problem hiding this comment.
please add javadoc and mention from what docker-api version it works.
|
@vuminhkh please exclude all unrelated to your change formatting and import changes |
* master: Fix potential NullpointerExceptions Fix changelog Renamed networStats to network Remove "Stats" from "networks" field in statistics Improve JavaDoc and include @checkfornull Deprecate "network" and enable "networks" stats (remote Docker API 1.21)
|
@KostyaSha I tried to use your formatting rules at docker-java/etc/code-style.epf and eclipse plugin for intellij, it seems that i's not your current formatting rules. So I made all the changes "manually", what do you advice about formatting rules in order to contribute to your project ? |
|
@vuminhkh Thanks! Hopefully I'm able to merge this evening... |
|
@vuminhkh After looking deeper into this I've just found that the API of The command should be able to transport a Beside this, the NullpointerExceptions that you got are caused by #388 |
* master: Added @nonnull annotations Pass mandatory container id into stats command constructor Update CHANGELOG.md Remove public from members as getters are public already Allow legacy registry message to indicate pull success Allow legacy registry message to indicate pull success Make ProgressDetails attributes public Update CHANGELOG.md Update CHANGELOG.md Add equals and hashCode for State Add test case Add missing properties for InspectContainerResponse.Status Add docker versions for easier javadoc reference Conflicts: src/main/java/com/github/dockerjava/api/DockerClient.java
|
@marcuslinke I agree with you, It's not much modification but the API is more generic. I updated the API according to your suggestion. Thanks, Minh Khang VU |
|
@vuminhkh i slowly adding checkstyle that matches to what marcus did. The standard rule for projects that has not yet defined styles is not mix styles and follow existed. And exclude unrelated to change changes. |
There was a problem hiding this comment.
(Not critical, but for simplification there are API versions for linking javadocs. Example
)There was a problem hiding this comment.
Try change link to version here also
|
@KostyaSha updated javadoc following your hint. Thanks, Minh Khang VU |
|
@vuminhkh implement classes is pretty simple, problem is wrote tests and verify this changes. |
|
@KostyaSha For commands that I implemented, if i'm not mistaken, I've written tests for them all. Normally what I wrote did not break any existing feature, tests that are broken were APIs which are not compatible anymore with newer Docker API. I have not fixed those tests yet, I'll do it once I have more time. If you guy could help me also on this it will be great as I don't have knowledge about those existing command. |
|
@marcuslinke @KostyaSha For breaking changes in docker API, what will be your strategy to be compatible with multiple docker api version ? |
|
Depends on cases. 2015-12-05 21:45 GMT+03:00 vuminhkh notifications@github.com:
|
|
@KostyaSha What is the configuration of your test ? Which version of docker do you target to assure that there's not regression ? If i'm not mistaken it's here https://github.com/docker-java/docker-java/blob/master/src/test/java/com/github/dockerjava/client/AbstractDockerClientTest.java#L41 that you define which version of API the test target. Is it ok if I change it to 1.21 ? |
|
I'm bit newbie with current tests design. @marcuslinke please suggest. |
|
@vuminhkh, @KostyaSha Currently we can only test against one specific version of the remote API. This is also the reason for the compatibility statement here: https://github.com/docker-java/docker-java#docker-java As you already found this is hard-coded in the |
|
@vuminhkh Thanks for contributing! |
Hello,
I've implemented "Copy file to container command", but it seems that migrating to 1.20 API breaks other part (8 tests failure). The commands that I modified, the test works well.
As I don't have enough knowledge of the project to fix them all, I still perform the pull request, hoping that it will be useful.
Thanks,
Minh Khang VU