Josef Cacek created JCLOUDS-1153:
------------------------------------

             Summary: Docker ImageToImage class doesn't support empty repoTags 
list
                 Key: JCLOUDS-1153
                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1153
             Project: jclouds
          Issue Type: Bug
          Components: jclouds-labs
    Affects Versions: 2.0.0
         Environment: Docker version 1.12
            Reporter: Josef Cacek


When a Docker image doesn't contain any repoTag, then the `ImageToImage` 
function fails with 

{code}
java.lang.IndexOutOfBoundsException: position (1) must be less than the number 
of elements that remained (1)
{code}

So the current implementation of listing Docker images fails when there is an 
image with empty {{repoTags}} field. (E.g. It happens after pulling a new 
"latest" tag of an image and the original image didn't have any other tags).

IMO the original intention was to throw NPE by this call in the 
{{ImageToImage.apply()}} method:
{code}
String description = checkNotNull(Iterables.getFirst(from.repoTags(), "image 
must have at least one repo tag"));
{code}

but it instead sets the {{description}} to {{"image must have at least one repo 
tag"}} and it fails later on splitting the value.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to