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/11 16:47:17 UTC

[jclouds/jclouds-labs] JCLOUDS-1153 Fix empty Docker repoTags field in ImageToImage function (#309)

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

This commit allows to work with empty `repoTags` field in Docker images.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * JCLOUDS-1153 Fix empty Docker repoTags field in ImageToImage function

-- File Changes --

    M docker/src/main/java/org/jclouds/docker/compute/functions/ImageToImage.java (24)
    M docker/src/test/java/org/jclouds/docker/compute/functions/ImageToImageTest.java (28)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/309.patch
https://github.com/jclouds/jclouds-labs/pull/309.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/309

Re: [jclouds/jclouds-labs] JCLOUDS-1153 Fix empty Docker repoTags field in ImageToImage function (#309)

Posted by Josef Cacek <no...@github.com>.
New version was pushed. I've removed the `parseVersion` method and made the relation between the `name` and `osVersion` more clear. A new test was also added for the repoTag which contains host and port.

-- 
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/309#issuecomment-239366846

Re: [jclouds/jclouds-labs] JCLOUDS-1153 Fix empty Docker repoTags field in ImageToImage function (#309)

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

-- 
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/309#event-753671679

Re: [jclouds/jclouds-labs] JCLOUDS-1153 Fix empty Docker repoTags field in ImageToImage function (#309)

Posted by Josef Cacek <no...@github.com>.
> @@ -91,9 +91,15 @@ public OsFamily apply(final String description) {
>        };
>     }
>  
> -   private String parseVersion(String description) {
> -      String version = get(Splitter.on(":").split(description), 1);
> -      logger.debug("os version for item: %s is %s", description, version);
> +   private String parseVersion(String repoTag) {
> +      String version;
> +      if (repoTag.contains(":")) {
> +         version = get(Splitter.on(":").split(repoTag), 1);
> +      } else {
> +         version = "<none>";

I will get rid of the whole `parseVersion` method. It's still not correct. There can be `repoTag` with port provided for repo-host (e.g. `internal-repository.company.example:8888/a/b/c/d:test`)

-- 
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/309/files/8a76eb96577a9ceaff9a43f370d4a159f9133d08#r74543160

Re: [jclouds/jclouds-labs] JCLOUDS-1153 Fix empty Docker repoTags field in ImageToImage function (#309)

Posted by Ignasi Barrera <no...@github.com>.
> @@ -91,9 +91,15 @@ public OsFamily apply(final String description) {
>        };
>     }
>  
> -   private String parseVersion(String description) {
> -      String version = get(Splitter.on(":").split(description), 1);
> -      logger.debug("os version for item: %s is %s", description, version);
> +   private String parseVersion(String repoTag) {
> +      String version;
> +      if (repoTag.contains(":")) {
> +         version = get(Splitter.on(":").split(repoTag), 1);
> +      } else {
> +         version = "<none>";

Would it be better to use `version = repoTag`? This way we don't couple this method to the placeholder value and make the method itself more flexible.

-- 
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/309/files/8a76eb96577a9ceaff9a43f370d4a159f9133d08#r74514123

Re: [jclouds/jclouds-labs] JCLOUDS-1153 Fix empty Docker repoTags field in ImageToImage function (#309)

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

-- 
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/309#issuecomment-239381245