Bug 1514907 - oc tag does not allow to add alias of ImageStreamTag in the same ImageStream
Summary: oc tag does not allow to add alias of ImageStreamTag in the same ImageStream
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-19 11:54 UTC by Kenjiro Nakayama
Modified: 2017-11-29 05:41 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-28 19:33:25 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1518497 None None None Never

Internal Links: 1518497

Description Kenjiro Nakayama 2017-11-19 11:54:12 UTC
Description of problem:
- Default (openshift project) imageStream https://github.com/openshift/openshift-ansible/blob/release-3.6/roles/openshift_examples/files/examples/v3.6/image-streams/image-streams-rhel7.json creates the ImageStream with ImageStreamTag alias like [1].

- However, when we try to create such ImageStream(Tags) by `oc tag` command, it fails due to the validation error.

```
# oc tag registry.access.redhat.com/rhscl/perl-520-rhel7:latest perl:latest --source=docker
# oc tag perl:latest perl:5.20 --source=istag 
# oc tag 5.20 perl:latest --source=istag --alias
error: --source=ImageStreamTag requires a valid <name>:<tag> in SOURCE
```

Version-Release number of selected component (if applicable):
- OCP 3.3 (also reproduced by OCP 3.6)

How reproducible: 100%

Steps to Reproduce:
- 1. Add alias of ImageStreamTag with following commands:

```
# oc tag registry.access.redhat.com/rhscl/perl-520-rhel7:latest perl:latest --source=docker
# oc tag perl:latest perl:5.20 --source=istag 
# oc tag 5.20 perl:latest --source=istag --alias
```
Actual results:
- oc tag 5.20 perl:latest --source=istag --alias fails due to this error.

```
# oc tag 5.20 perl:latest --source=istag --alias
error: --source=ImageStreamTag requires a valid <name>:<tag> in SOURCE
```

Expected results:
- Create the ImageStream as [1].

Additional info: proposal patch https://github.com/openshift/origin/pull/17377

[1]
```
apiVersion: v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/display-name: Perl
  name: perl
spec:
  tags:
  - annotations:
      version: "5.20"
    from:
      kind: DockerImage
      name: registry.access.redhat.com/rhscl/perl-520-rhel7:latest
    generation: 2
    importPolicy: {}
    name: "5.20"
  - annotations:
      version: "latest"
    from:
      kind: ImageStreamTag
      name: "5.20"
    generation: 1
    importPolicy: {}
    name: latest
```

Comment 1 Juan Vallejo 2017-11-20 15:12:56 UTC
Origin PR: https://github.com/openshift/origin/pull/17377

Comment 2 Ben Parees 2017-11-28 18:45:53 UTC
per my comments in https://github.com/openshift/origin/pull/17377#issuecomment-347619700

i think this should be closed as not a bug/won't fix.

Comment 3 Juan Vallejo 2017-11-28 19:33:25 UTC
> per my comments in https://github.com/openshift/origin/pull/17377#issuecomment-347619700

> i think this should be closed as not a bug/won't fix.

Given that usability is currently not affected in any way, and per bparees 's comment on the PR [1], I agree that the command's current behavior of specifying an imagestreamtag for both the source and destination, rather than just the tag name for either, is the least ambiguous approach.

1. https://github.com/openshift/origin/pull/17377#issuecomment-347619700

Comment 4 Kenjiro Nakayama 2017-11-29 05:41:15 UTC
As per Ben's comment https://github.com/openshift/origin/pull/17377#issuecomment-347743443 I opened another bz ticket as https://bugzilla.redhat.com/show_bug.cgi?id=1518497


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