Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1468165

Summary: Fail to import-image tag with the error msg unexpected
Product: OpenShift Container Platform Reporter: ge liu <geliu>
Component: Image RegistryAssignee: Jim Minter <jminter>
Status: CLOSED WONTFIX QA Contact: ge liu <geliu>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.6.0CC: aos-bugs, bparees, ccoleman, mfojtik, pweil, trankin, xtian
Target Milestone: ---   
Target Release: 3.7.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1469916 1471685 (view as bug list) Environment:
Last Closed: 2017-10-03 19:10:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1469916, 1471685    

Description ge liu 2017-07-06 07:24:34 UTC
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

Comment 1 Clayton Coleman 2017-07-06 11:45:32 UTC
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.

Comment 4 Ben Parees 2017-10-02 19:43:13 UTC
Time to start spreading the registry/image wealth.  Let's let Jim have a crack at this.

Comment 5 Jim Minter 2017-10-03 19:10:04 UTC
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.