Bug 1468165 - Fail to import-image tag with the error msg unexpected
Summary: Fail to import-image tag with the error msg unexpected
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image Registry
Version: 3.6.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: 3.7.0
Assignee: Jim Minter
QA Contact: ge liu
URL:
Whiteboard:
Depends On:
Blocks: 1469916 1471685
TreeView+ depends on / blocked
 
Reported: 2017-07-06 07:24 UTC by ge liu
Modified: 2017-10-03 19:10 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1469916 1471685 (view as bug list)
Environment:
Last Closed: 2017-10-03 19:10:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.