Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1348174 - Inconsistent output message after oc import-image with non-existent tag
Summary: Inconsistent output message after oc import-image with non-existent tag
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Image Registry
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.x
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-20 10:38 UTC by Xingxing Xia
Modified: 2017-05-30 12:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: When .spec.dockerImageRepository was specified it was possible to import a non-existing tag. Consequence: Non-existing tags where added to ImageStream pointing to .spec.dockerImageRepository. Fix: Fix the image-import command in such a way it does not import non-existing tags. Result: One will get an error when trying to import non-existing image.
Clone Of:
Environment:
Last Closed: 2017-05-30 12:48:55 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Xingxing Xia 2016-06-20 10:38:53 UTC
Description of problem:
After oc import-image with non-existent tag, it outputs inconsistent messages for imagestreams with and without spec.dockerImageRepository.

Version-Release number of selected component (if applicable):
oc v1.3.0-alpha.1-439-g604ae17
kubernetes v1.3.0-alpha.3-599-g2746284

How reproducible:
Always

Steps to Reproduce:
1. Create a new ImageStream
$ cat python.json
{
    "kind": "ImageStream",
    "apiVersion": "v1",
    "metadata": {
      "name": "python",
      "creationTimestamp": null
    },
    "spec": {
      "dockerImageRepository": "wsun/python-33-centos"
      }
}

$ oc create -f python.json

2. Import image with a non-existent tag:
$ oc import-image python:notexist
The import completed successfully.
...

Tag		Spec				Created		PullSpec					Image
latest		wsun/python-33-centos:latest	29 minutes ago	wsun/python-33-centos@sha256:354d212f9a8c77...	<same>
...
notexist	wsun/python-33-centos		1 seconds ago	wsun/python-33-centos@sha256:354d212f9a8c77...	<same>

3 $ oc edit is python # Under 'spec', remove dockerImageRepository: wsun/python-33-centos
imagestream "python" edited

4 Try import-image with non-existent tag again:
$ oc import-image python:none
error: the tag "none" does not exist on the image stream - choose an existing tag to import or use the 'tag' command to create a new tag

Actual results:
For a non-existent tag, step 2 succeeds and step 4 shows error.

Expected results:
For a non-existent tag, step 2 should also output message to notify that the given tag is not existent.

Additional info:

Comment 1 Maciej Szulik 2017-01-03 17:03:54 UTC
Fix in https://github.com/openshift/origin/pull/12376

Comment 2 openshift-github-bot 2017-01-04 18:27:40 UTC
Commits pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/d2e21f7ad9bae35395ebcbc26def69ef7e112eff
Bug 1348174 - error on non-existing tag when importing from .spec.dockerImageRepository

https://github.com/openshift/origin/commit/1e0571e56ac97007937d6ccdfab238c910a8b581
Merge pull request #12376 from soltysh/bug1348174

Merged by openshift-bot

Comment 3 Xingxing Xia 2017-01-05 07:42:37 UTC
Checked with:
$ oc version
oc v1.5.0-alpha.1+04db561-37
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://<master>:8443
openshift v1.5.0-alpha.1+04db561-37
kubernetes v1.4.0+776c994

Using original steps in comment 0, now step 2 also outputs message to notify that the given tag is not existent:
error: the tag "notexist" does not exist on the image stream - choose an existing tag to import or use the 'tag' command to create a new tag

That's consistent with step 4. Fixed

Thx!


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