Bug 1315625 - In the context of source project, oc tag fails when source project is omitted and another destination project is given
In the context of source project, oc tag fails when source project is omitted...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Juan Vallejo
Wei Sun
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-08 04:23 EST by Xingxing Xia
Modified: 2016-09-19 09:51 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-19 09:51:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Xingxing Xia 2016-03-08 04:23:32 EST
Description of problem:
oc tag [source project/]<is name:tag1> [another destination project/]<is name:tag2> fails in the case described in summary

Version-Release number of selected component (if applicable):
oc v1.1.3-500-g115660e
kubernetes v1.2.0-alpha.7-703-gbc4550d

How reproducible:
Always

Steps to Reproduce:
1. oc login, create projects: xxia-proj1, xxia-proj2
2. Switch to xxia-proj1 and prepare an imagestream
$ oc project xxia-proj1
$ oc tag --source=docker openshift/hello-openshift mystream:latest
3. Tag image to between 2 projects in the context of xxia-proj1. Omit or give project name(s):
1> oc tag xxia-proj1/mystream:latest xxia-proj2/stream:latest
2> oc tag mystream:latest mystream:tag1
3> oc tag xxia-proj2/stream:latest mystream:tag2
4> oc tag mystream:latest xxia-proj2/stream:tag1

Actual results:
3.
1> ~ 3>: All commands succeed.
4> Fails with following error
The ImageStream "stream" is invalid.
spec.tags[tag1].from.name: Not found: "mystream@sha256:dfcc619a443feb75eff04228942af3ff1f2efb580d78e097e0f10e75f93913fb"

Expected results:
3.
4> Should also succeed

Additional info:
Comment 1 Juan Vallejo 2016-08-17 17:34:47 EDT
Hm, I cannot seem to reproduce this bug:

oc version:
oc v1.3.0-alpha.0+1347137-dirty
kubernetes v1.3.0+507d3a7
features: Basic-Auth

1. oc login, create projects: streamtags1, streamtags2
2. Switch to streamtags2 and prepare an imagestream
    $ oc tag --source=docker openshift/hello-openshift mystream:latest

3. Switch to streamtags1 and prepare an imagestream
    $ oc tag --source=docker openshift/hello-openshift mystream:latest

4. Tag image to between 2 projects in the context of streamtags1. Omit or give project name(s):

1> oc tag streamtags1/mystream:latest streamtags2/stream:latest
2> oc tag mystream:latest mystream:tag1
3> oc tag streamtags2/stream:latest mystream:tag2
4> oc tag mystream:latest streamtags2/stream:tag1

Actual Results:
4.
1> ~ 3>: All commands succeeded with same results as comment https://bugzilla.redhat.com/show_bug.cgi?id=1315625#c0
4> Command also succeeded with output:
"Tag streamtags2/stream:tag1 set to mystream@sha256:b9b69935f23d56775aeb548d3aa526bd9cb53d8fa49faf4839f8b5eaf3dbe108."
Comment 2 Xingxing Xia 2016-08-17 23:19:41 EDT
Strictly follow comment 0 steps, error for "oc tag mystream:latest xxia-proj2/stream:tag1" is still reproduced.

Strictly follow your steps in comment 0, "oc tag mystream:latest streamtags2/stream:tag1" indeed succeeds.

The difference is: comment 1 has additional step "Switch to streamtags2 and prepare an imagestream". If skip this step, the error is then reproduced, as same as comment 0.
Comment 3 Xingxing Xia 2016-08-17 23:20:47 EDT
(In reply to Xingxing Xia from comment #2)
> Strictly follow your steps in comment 0, "oc tag mystream:latest
> streamtags2/stream:tag1" indeed succeeds.

Sorry, a typo, should be "your steps in comment 1"
Comment 4 Juan Vallejo 2016-08-18 15:01:21 EDT
Thanks for the clarification. Related PR: https://github.com/openshift/origin/pull/10510
Comment 5 Xingxing Xia 2016-08-22 23:17:48 EDT
Verified in openshift v1.3.0-alpha.3+31f6add (also in OCP v3.3.0.24). Fixed. Comment 0 step 3.4 succeeds with output:
Tag xxia-proj2/stream:tag1 set to mystream@sha256:...

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