Bug 1315625 - In the context of source project, oc tag fails when source project is omitted and another destination project is given
Summary: In the context of source project, oc tag fails when source project is omitted...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-08 09:23 UTC by Xingxing Xia
Modified: 2016-09-19 13:51 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 13:51:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xingxing Xia 2016-03-08 09:23:32 UTC
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 21:34:47 UTC
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-18 03:19:41 UTC
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-18 03:20:47 UTC
(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 19:01:21 UTC
Thanks for the clarification. Related PR: https://github.com/openshift/origin/pull/10510

Comment 5 Xingxing Xia 2016-08-23 03:17:48 UTC
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.