Skip to content

Add support for reference query param in List Images#1941

Merged
eddumelendez merged 5 commits intomasterfrom
gh-1935
Oct 6, 2022
Merged

Add support for reference query param in List Images#1941
eddumelendez merged 5 commits intomasterfrom
gh-1935

Conversation

@eddumelendez
Copy link
Copy Markdown
Member

@eddumelendez eddumelendez commented Sep 10, 2022

filter query param was removed in Docker API 1.41. Using reference
query param will allow to use format <image-name>[:<tag>].

`filter` query param was removed in Docker API 1.41. Using `reference`
query param will allow to use format <image-name>[:<tag>].
Comment thread docker-java/src/test/java/com/github/dockerjava/cmd/ListImagesCmdIT.java Outdated
*
* @param reference string in the form {@code <image-name>[:<tag>]}
*/
ListImagesCmd withReferenceFilter(String reference);
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.

Thinking out loud: should we add withFilter(String name, Collection<String> value) and make these methods default implementations that would call it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

agree!

Copy link
Copy Markdown
Contributor

@kiview kiview Sep 28, 2022

Choose a reason for hiding this comment

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

What is the reason for having it as a default method rather than in the Impl class? Binary compatibility if there are implementations of ListImagesCmd by users out there?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a good point to not break existing implementations. However, FiltersBuilder belongs to the core module, not the api

@bsideup bsideup added this to the next milestone Sep 10, 2022
@docker-java docker-java deleted a comment from Alamu-Eth Sep 12, 2022
List<Image> images = dockerRule.getClient().listImagesCmd().withReferenceFilter("docker-java/busybox")
.exec();
assertThat(images, hasSize(1));
dockerRule.getClient().removeImageCmd("docker-java/busybox:" + tag).exec();
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.

Should be in finally block here and listImagesWithFilter

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this one should too, right?

dockerRule.getClient().tagImageCmd("busybox:latest", "docker-java/busybox", tag).exec();
dockerRule.getClient().removeImageCmd("docker-java/busybox:" + tag).exec();

Copy link
Copy Markdown
Member

@bsideup bsideup left a comment

Choose a reason for hiding this comment

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

approved with a nit

@eddumelendez eddumelendez merged commit 3951333 into master Oct 6, 2022
@eddumelendez eddumelendez deleted the gh-1935 branch November 29, 2023 03:24
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