You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Josef Cacek <no...@github.com> on 2016/08/22 13:25:24 UTC

[jclouds/jclouds-labs] JCLOUDS-1158 fix Docker find image Predicate (#314)

JIRA: https://issues.apache.org/jira/browse/JCLOUDS-1158

This commit contains fix for predicate used to find docker image. It resolves behavior on RHEL (Atomic) which uses "docker.io/" prefixed repoTag entries.

The commit also contains a new unit test to cover the change.
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/314

-- Commit Summary --

  * JCLOUDS-1158 fix Docker find image Predicate for cases where repoTags field contains 'docker.io/' registry host prefix

-- File Changes --

    M docker/src/main/java/org/jclouds/docker/compute/strategy/DockerComputeServiceAdapter.java (27)
    M docker/src/test/java/org/jclouds/docker/compute/DockerComputeServiceAdapterLiveTest.java (2)
    A docker/src/test/java/org/jclouds/docker/compute/strategy/PredicateLocateImageByNameTest.java (111)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/314.patch
https://github.com/jclouds/jclouds-labs/pull/314.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/314

Re: [jclouds/jclouds-labs] JCLOUDS-1158 fix Docker find image Predicate (#314)

Posted by Josef Cacek <no...@github.com>.
I've changed the logic, so it uses regular expression now.

Optional prefix and suffix were moved into constants.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/314#issuecomment-243194759

Re: [jclouds/jclouds-labs] JCLOUDS-1158 fix Docker find image Predicate (#314)

Posted by Ignasi Barrera <no...@github.com>.
> @@ -329,4 +319,19 @@ public void suspendNode(String id) {
>        api.getContainerApi().pause(id);
>     }
>  
> +   protected static Predicate<Image> createPredicateMatchingRepoTags(final String imageIdOrName) {
> +      return new Predicate<Image>() {
> +         @Override
> +         public boolean apply(Image input) {
> +            final String imageNameWithHostPrefix = "docker.io/" + imageIdOrName;

Move "docker.io" to a constant that can be referenced from the tests too? IIRC previous versions of Docker prefixed official images with `library/`. I agree this is unlikely to change, but I think it is worth having that prefix isolated in a single constant.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/314/files/b68a1f96477a97cb85401b42739d4aca9f78dda4#r76522681

Re: [jclouds/jclouds-labs] JCLOUDS-1158 fix Docker find image Predicate (#314)

Posted by Ignasi Barrera <no...@github.com>.
Closed #314.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/314#event-771256770

Re: [jclouds/jclouds-labs] JCLOUDS-1158 fix Docker find image Predicate (#314)

Posted by Ignasi Barrera <no...@github.com>.
Thanks @kwart, you rock! :) Merged to master as [44946467]( http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/44946467).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/314#issuecomment-243248998

Re: [jclouds/jclouds-labs] JCLOUDS-1158 fix Docker find image Predicate (#314)

Posted by Ignasi Barrera <no...@github.com>.
Thanks @kwart! Just a minor comment. Apart from that LGTM!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/314#issuecomment-242942283