Description of problem: in our document: https://docs.openshift.com/enterprise/3.1/architecture/core_concepts/builds_and_image_streams.html#tag-tracking you could set tag as following using oc tag command: "spec": { "tags": [ { "name": "latest", "from": { "kind": "ImageStreamTag", "name": "2.0" } } ] } in this way you could make sure you will deploy latest by deploy 2.0. However in 3.1 when you use oc tag, you will get following in image stream: "spec": { "tags": [ { "name": "2.0", "from": { "kind": "ImageStreamImage", "name": "cakephp-example@sha256:218dcb6c709960e62e1e1ee46721bed35dfe141695f3f0df60b755a0e66ed420" } }, { "name": "latest", "from": { "kind": "ImageStreamImage", "name": "cakephp-example@sha256:218dcb6c709960e62e1e1ee46721bed35dfe141695f3f0df60b755a0e66ed420" } } ] }, You could also deploy 2.0 by deploy latest but the difference between this and the document is you lose the track between 2.0 and latest. It means when you want to use this image in multiple project with multiple tags, you are not sure which image is deployed unless you check sha value. Version-Release number of selected component (if applicable): How reproducible: # oc tag cakephp-example:latest cakephp-example:2.0 Steps to Reproduce: 1.oc tag cakephp-example:latest cakephp-example:2.0 2. 3. Actual results: "spec": { "tags": [ { "name": "2.0", "from": { "kind": "ImageStreamImage", "name": "cakephp-example@sha256:218dcb6c709960e62e1e1ee46721bed35dfe141695f3f0df60b755a0e66ed420" } }, { "name": "latest", "from": { "kind": "ImageStreamImage", "name": "cakephp-example@sha256:218dcb6c709960e62e1e1ee46721bed35dfe141695f3f0df60b755a0e66ed420" } } ] }, Expected results: "spec": { "tags": [ { "name": "0.0.2", "from": { "kind": "ImageStreamImage", "name": "aem-processing@sha256:the_built_0.0.2_image" } }, { "name": "0.0.1", "from": { "kind": "ImageStreamImage", "name": "aem-processing@sha256:the_built_0.0.1_image" } }, { "name": "release", "from": { "kind": "ImageStreamTag", "name": "0.0.1" } }, { "name": "prerelease", "from": { "kind": "ImageStreamTag", "name": "0.0.2" } }, { "name": "latest", "from": { "kind": "DockerImage", "name": "aem-processing:latest" } } ] } Additional info:
What you're looking for is --alias option to oc tag. I've create is python and then tagged it twice: oc tag python:latest python:normal oc tag python:latest python:alias --alias and this is what I got: spec: tags: - from: kind: DockerImage name: centos/python-34-centos7 name: latest - from: kind: ImageStreamImage name: python@sha256:ec180c95fe33723f843355b461827cfbef2e7a19b987f7799e029df99d66fdbf name: regular - from: kind: ImageStreamTag name: python:latest name: alias
Verified using the following version: $ openshift version openshift v3.1.1.6 kubernetes v1.1.0-origin-1107-g4c8e6f4 etcd 2.1.2 Result: oc tag python:3.4 python:normal oc tag python:3.4 python:alias --alias oc get is python -o yaml from: kind: DockerImage name: centos/python-34-centos7:latest name: "3.4" - from: kind: ImageStreamTag name: python:3.4 name: alias - from: kind: ImageStreamTag name: "3.4" name: latest - from: kind: ImageStreamImage name: python@sha256:ec180c95fe33723f843355b461827cfbef2e7a19b987f7799e029df99d66fdbf name: normal
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2016:1064