Skip to content

Patch save image with tag#521

Closed
draoullig wants to merge 3 commits intodocker-java:masterfrom
draoullig:master
Closed

Patch save image with tag#521
draoullig wants to merge 3 commits intodocker-java:masterfrom
draoullig:master

Conversation

@draoullig
Copy link
Copy Markdown

Hy,

I found a bug on the command to save images in a tar.
If you push a tag today, it is ignored because the tag is push in queryParam and not in the url (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.19/#get-a-tarball-containing-all-images-in-a-repository).
I made an evolution to patch this problem.

Best regards

Frederic


This change is Reviewable

WebTarget webResource = getBaseResource().path("/images/" + command.getName() + "/get").queryParam("tag",
command.getTag());

// If tag is present, only tar the specific image
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.

tar?

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.

sorry confused with tar, tag :)

@KostyaSha
Copy link
Copy Markdown
Member

Seems we would need a test case for it

@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 24, 2016

Codecov Report

❗ No coverage uploaded for pull request base (master@8be5180). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #521   +/-   ##
=========================================
  Coverage          ?   71.77%           
=========================================
  Files             ?      306           
  Lines             ?     6598           
  Branches          ?      487           
=========================================
  Hits              ?     4736           
  Misses            ?     1575           
  Partials          ?      287
Impacted Files Coverage Δ
.../com/github/dockerjava/jaxrs/SaveImageCmdExec.java 100% <100%> (ø)

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 8be5180...c1b7ace. Read the comment docs.

@draoullig
Copy link
Copy Markdown
Author

Hi,

I change my chectstyle environment to be compliant with us.
I add a test integration too.

Best Regards

Frédéric.

@KostyaSha
Copy link
Copy Markdown
Member

Missing netty implementation.
Would this change be backward compatible with previous (docker daemon) API versions?

@KostyaSha
Copy link
Copy Markdown
Member

As i see save Save an image(s) to a tar archive


Usage:  docker save [OPTIONS] IMAGE [IMAGE...]

Save an image(s) to a tar archive (streamed to STDOUT by default)

  --help             Print usage
  -o, --output       Write to a file, instead of STDOUT

Requires only image name. But docker API also allows passing names query. So as library we should support all this options.

https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api_v1.22.md#get-a-tarball-containing-all-images-in-a-repository contains some https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api_v1.22.md#image-tarball-format format. Could you check whether this format is right now and whether it possible implement some integration test (tag something (i.e. busybox) with test specific repository name and verify that returned archive contains tags/images). I think you can add commons-compress into test scope if it missing?

Test would allow cover situations and avoid breakage in future.

@marcuslinke
Copy link
Copy Markdown
Contributor

@draoullig Ping!

@draoullig
Copy link
Copy Markdown
Author

Hi,

I don't have time to contribue at this project.
I made this patch to solve the bug in a jenkins plugin.
I send you this solution to fix the bug even all the differents uses cases are not covered.

Best regards.

Frédéric

@KostyaSha
Copy link
Copy Markdown
Member

@draoullig thanks, it will take some time to update your changes and we will merge later.

@KostyaSha
Copy link
Copy Markdown
Member

retriggering pr build

@cdancy
Copy link
Copy Markdown
Contributor

cdancy commented Jan 24, 2019

Any chance we could get this PR massaged and cleaned up and merged?

@KostyaSha
Copy link
Copy Markdown
Member

Any chance we could get this PR massaged and cleaned up and merged?

Too busy on this week, i can press merge and run relese. Could you PR picking this commits?

@KostyaSha KostyaSha mentioned this pull request Jan 28, 2019
@KostyaSha
Copy link
Copy Markdown
Member

#1155

@KostyaSha KostyaSha closed this Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants