Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1158

DockerComputeServiceAdapter.getImage(String) doesn't work correctly for Docker on RHEL Atomic host

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • jclouds-labs

    Description

      The org.jclouds.docker.compute.strategy.DockerComputeServiceAdapter.getImage(String) method doesn't find images when Docker from RHEL (Atomic) is used. The reason is the returned Image repoTags field from the Docker server contains also registry hostname. E.g.

      "RepoTags":["docker.io/kwart/alpine-ext:3.3-ssh"]
      

      The problem is in the condition used in this piece of code:

      for (String tag : input.repoTags()) {
         if (tag.equals(imageIdOrName) || tag.equals(imageIdOrName + ":latest")) {
            return true;
         }
      }
      

      IMO, we should add also 2 more options to statement:

      final String imageNameWithHostPrefix = "docker.io/" + imageIdOrName;
      for (String tag : input.repoTags()) {
         if (tag.equals(imageIdOrName) || tag.equals(imageIdOrName + ":latest")
            || tag.equals(imageNameWithHostPrefix) || tag.equals(imageNameWithHostPrefix + ":latest")) {
      ...
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            kwart Josef Cacek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment