Description of problem: run 'oc import-image' successfully at first time, then run 'oc delete istag' to delet the image tag just import, try run import-image again, it prompt unexpect error msg: "error: image stream does not have valid docker images to be imported" openshift v3.6.135 kubernetes v1.6.1+5115d708d7 etcd 3.2.1 How reproducible: Always Steps to Reproduce: 1.# oc import-image --confirm --from=centos/ruby-22-centos7 ruby-22-centos7:latest The import completed successfully. 2.# oc get is NAME DOCKER REPO TAGS UPDATED ruby-22-centos7 docker-registry.default.svc:5000/lgproj/ruby-22-centos7 latest 3 seconds ago 3. # oc get istag NAME DOCKER REF UPDATED IMAGENAME ruby-22-centos7:latest centos/ruby-22-centos7@sha256:fb5bf6dcd15e89f5b18f2022f7c4c76d0ee442958085cbe09758250898231866 4 minutes ago sha256:fb5bf6dcd15e89f5b18f2022f7c4c76d0ee442958085cbe09758250898231866 # oc delete istag ruby-22-centos7:latest imagestreamtag "ruby-22-centos7:latest" deleted 4. # oc get is NAME DOCKER REPO TAGS UPDATED ruby-22-centos7 docker-registry.default.svc:5000/lgproj/ruby-22-centos7 5. # oc import-image --confirm --from=centos/ruby-22-centos7 ruby-22-centos7:latest error: image stream does not have valid docker images to be imported Actual results: import-image again failed and prompted misguide error msg after deleted image tag Expected results: import-image again should succeed
import-image deals with image streams, not with tags. The specified tag ":latest" no longer exists after you delete it. The error message should be better, but this is not new behavior.
Time to start spreading the registry/image wealth. Let's let Jim have a crack at this.
oc import-image is inconsistent and should in due course be deprecated in favour of a better designed replacement, as the changes that are required cannot be made without breaking API. In step 5, the command "oc tag --source=docker centos/ruby-22-centos7:latest ruby-22-centos7:latest" should have been used. "--from" should not be used when an imagestream already exists. Given the intent to replace the tool, it is not intended to update the error message.