Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1463890

Summary: Can't tag the build image with another alias
Product: OpenShift Container Platform Reporter: zhou ying <yinzhou>
Component: Image RegistryAssignee: Maciej Szulik <maszulik>
Status: CLOSED ERRATA QA Contact: ge liu <geliu>
Severity: high Docs Contact:
Priority: high    
Version: 3.6.0CC: aos-bugs, ccoleman, mfojtik, pweil, xiuwang, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-10 05:28:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description zhou ying 2017-06-22 03:07:35 UTC
Description of problem:
Build an image, use command try to tag the image with another tag alias then will failed with error:
The ImageStreamTag "ruby-ex:20" is invalid: metadata: Invalid value: "": may not update fields other than metadata.annotations

Version-Release number of selected component (if applicable):
openshift v3.6.121
kubernetes v1.6.1+5115d708d7
etcd 3.2.0

How reproducible:
always

Steps to Reproduce:
1. Login openshift and create project;
2. Use command to create app and build new images:
   `oc new-build centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git`
3. Wait for the build completed, and try to tag image with command:
   `oc tag 172.30.136.252:5000/x52a7/ruby-ex:latest --source=docker x52a7/ruby-ex:20 --insecure=true`
   `oc tag ruby-ex:latest --source=istag ruby-ex:tag --alias=true`

Actual results:
3. The command failed with error:
The ImageStreamTag "ruby-ex:20" is invalid: metadata: Invalid value: "": may not update fields other than metadata.annotations

Expected results:
3.Should able to tag the imagestream with new alias.

Additional info:

Comment 1 Maciej Szulik 2017-06-23 14:29:41 UTC
The fix is in https://github.com/openshift/origin/pull/14803

Comment 2 Clayton Coleman 2017-07-07 18:16:42 UTC
This may be an API compatibility break, and thus may block the release.

Comment 3 Clayton Coleman 2017-07-07 18:16:50 UTC
This may be an API compatibility break, and thus may block the release.

Comment 4 Clayton Coleman 2017-07-07 18:43:21 UTC
Fix for the API compatibility issue in https://github.com/openshift/origin/pull/15098

Comment 8 ge liu 2017-07-24 08:06:23 UTC
We will try to verify it after the build ready ASAP.

Comment 9 zhou ying 2017-07-25 02:52:29 UTC
Confirmed with latest OCP, the issue has fixed:
openshift v3.6.169
kubernetes v1.6.1+5115d708d7
etcd 3.2.1

[root@zhouy testjson]# oc tag docker-registry.default.svc:5000/zhouy/ruby-ex --source=docker zhouy/ruby-ex:20 --insecure=true
Tag ruby-ex:20 set to docker-registry.default.svc:5000/zhouy/ruby-ex.
[root@zhouy testjson]# oc get is
NAME              DOCKER REPO                                              TAGS        UPDATED
ruby-22-centos7   docker-registry.default.svc:5000/zhouy/ruby-22-centos7   latest      About a minute ago
ruby-ex           docker-registry.default.svc:5000/zhouy/ruby-ex           20,latest   Less than a second ago


[root@zhouy testjson]# oc tag ruby-ex:latest --source=istag ruby-ex:tag --alias=true
Tag ruby-ex:tag set up to track ruby-ex:latest.
[root@zhouy testjson]# oc get is
NAME              DOCKER REPO                                              TAGS            UPDATED
ruby-22-centos7   docker-registry.default.svc:5000/zhouy/ruby-22-centos7   latest          2 minutes ago
ruby-ex           docker-registry.default.svc:5000/zhouy/ruby-ex           20,latest,tag   13 seconds ago
[root@zhouy testjson]# oc get is ruby-ex -o yaml 
apiVersion: v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/generated-by: OpenShiftNewApp
    openshift.io/image.dockerRepositoryCheck: 2017-07-25T02:49:00Z
  creationTimestamp: 2017-07-25T02:46:28Z
  generation: 4
  labels:
    app: ruby-ex
  name: ruby-ex
  namespace: zhouy
  resourceVersion: "3442"
  selfLink: /oapi/v1/namespaces/zhouy/imagestreams/ruby-ex
  uid: 750a250a-70e3-11e7-973d-fa163ece11cf
spec:
  lookupPolicy:
    local: false
  tags:
  - annotations: null
    from:
      kind: DockerImage
      name: docker-registry.default.svc:5000/zhouy/ruby-ex
    generation: 3
    importPolicy:
      insecure: true
    name: "20"
    referencePolicy:
      type: Source
  - annotations: null
    from:
      kind: ImageStreamTag
      name: ruby-ex:latest
    generation: 4
    importPolicy: {}
    name: tag
    referencePolicy:
      type: Source
status:
  dockerImageRepository: docker-registry.default.svc:5000/zhouy/ruby-ex
  tags:
  - items:
    - created: 2017-07-25T02:47:20Z
      dockerImageReference: docker-registry.default.svc:5000/zhouy/ruby-ex@sha256:78f34814616d36c7282d62135faf81bd366e62e60c7c3425bb89ca07aa6ee335
      generation: 4
      image: sha256:78f34814616d36c7282d62135faf81bd366e62e60c7c3425bb89ca07aa6ee335
    tag: latest
  - items:
    - created: 2017-07-25T02:49:00Z
      dockerImageReference: docker-registry.default.svc:5000/zhouy/ruby-ex@sha256:78f34814616d36c7282d62135faf81bd366e62e60c7c3425bb89ca07aa6ee335
      generation: 3
      image: sha256:78f34814616d36c7282d62135faf81bd366e62e60c7c3425bb89ca07aa6ee335
    tag: "20"
  - items:
    - created: 2017-07-25T02:47:20Z
      dockerImageReference: docker-registry.default.svc:5000/zhouy/ruby-ex@sha256:78f34814616d36c7282d62135faf81bd366e62e60c7c3425bb89ca07aa6ee335
      generation: 4
      image: sha256:78f34814616d36c7282d62135faf81bd366e62e60c7c3425bb89ca07aa6ee335
    tag: tag

Comment 11 errata-xmlrpc 2017-08-10 05:28:56 UTC
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/RHEA-2017:1716

Comment 12 Red Hat Bugzilla 2023-09-14 03:59:39 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days