Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-22580

Deploy Docker Image wizard: Cannot push already tagged image to docker registry

XMLWordPrintable

    • 6
    • Hide

      ASSERT: Have a docker connection with some images.
      EXEC: Tag any image with CDK's docker registry. E.g. hub.openshift.rhel-cdk.10.1.2.2.xip.io/msa/helloworld
      EXEC: Open context menu of the image and select Deploy to OpenShift item.
      EXEC: In Deploy Image to OpenShift wizard check the checkbox to push image to docker registry of OpenShift.
      EXEC: Click Next button and then finish.

      RESULT: Error with already existing tag is shown.
      EXPECTED RESULT: Either I will be prompted to confirm push or it will be pushed automatically.

      Show
      ASSERT: Have a docker connection with some images. EXEC: Tag any image with CDK's docker registry. E.g. hub.openshift.rhel-cdk.10.1.2.2.xip.io/msa/helloworld EXEC: Open context menu of the image and select Deploy to OpenShift item. EXEC: In Deploy Image to OpenShift wizard check the checkbox to push image to docker registry of OpenShift. EXEC: Click Next button and then finish. RESULT: Error with already existing tag is shown. EXPECTED RESULT: Either I will be prompted to confirm push or it will be pushed automatically.

      There is a CDK docker registry located at hub.openshift.rhel-cdk.10.1.2.2.xip.io. From command line user has to tag image at first before pushing it to remote registry to match registry URL, e.g. to push image msa/helloworld from local repository to CDK docker registry I have to tag image as follows hub.openshift.rhel-cdk.10.1.2.2.xip.io/msa/helloworld and then I can just push it "docker push hub.openshift.rhel-cdk.10.1.2.2.xip.io/msa/helloworld". Users used to command line tooling and not aware of "auto-tag" feature of OpenShift tooling can bump into issues. When I am trying to push already tagged image (as I would be expecting from command line) I get an error with following stack trace

      Failed to push the selected Docker image into OpenShift registry
      
      org.eclipse.linuxtools.docker.core.DockerException: Conflict: Tag latest is already set to image 2e0ddd37ace80cf13a9d3c664445430972fb3440661eb5d8efb7cc994f11bbdb, if you want to replace it, please use -f option
      	at org.eclipse.linuxtools.internal.docker.core.DockerConnection.tagImage(DockerConnection.java:1083)
      	at org.jboss.tools.openshift.internal.ui.dockerutils.PushImageToRegistryJob.doRun(PushImageToRegistryJob.java:65)
      	at org.jboss.tools.openshift.internal.common.core.job.AbstractDelegatingMonitorJob.run(AbstractDelegatingMonitorJob.java:37)
      	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
      

      I think it would be better at first try to check, whether an image does not already have specific tag and if it does, then we should involve confirmation dialog to use force push. If there is no such tagged image, push would behave as it is. Alternatively after checking of image existence we could just simply ignore it, because it is being tagged on same tag.

              xcoulon@redhat.com Xavier Coulon
              mlabuda_jira Marián Labuda (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: