Bug 1518502 - Creating oc tag alias shows importing latest image forever
Summary: Creating oc tag alias shows importing latest image forever
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 3.9.0
Assignee: Corey Daley
QA Contact: Dongbo Yan
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-29 05:53 UTC by Kenjiro Nakayama
Modified: 2018-03-28 14:13 UTC (History)
7 users (show)

(edit)
undefined
Clone Of:
(edit)
Last Closed: 2018-03-28 14:13:03 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 None None None 2018-03-28 14:13 UTC

Description Kenjiro Nakayama 2017-11-29 05:53:08 UTC
Description of problem:
- Creating oc tag alias shows importing latest image forever

Version-Release number of selected component (if applicable):
- OCP 3.6

How reproducible: 100%

Steps to Reproduce:
1. Create imageStreamTag with these two commands:

  # oc tag registry.access.redhat.com/rhscl/perl-520-rhel7:latest perl:5.20 --source=docker
  # oc tag perl:5.20 perl:latest --source=istag --alias

2. Check oc describe is perl

Actual results:
-  5.20 tag displays "importing latest image ..." forever.

(Full output)
~~~
$ oc describe is perl
Name:			perl
Namespace:		demo
Created:		12 seconds ago
Labels:			<none>
Annotations:		openshift.io/image.dockerRepositoryCheck=2017-11-29T05:44:47Z
Docker Pull Spec:	172.30.200.222:5000/demo/perl
Image Lookup:		local=false
Unique Images:		1
Tags:			2

latest
  tagged from perl:5.20

  * registry.access.redhat.com/rhscl/perl-520-rhel7@sha256:d0b7011aa1a7e961d96388ec062a0b3a03ff8e0e3225f7290f36ab8316724420
      11 seconds ago

5.20
  tagged from registry.access.redhat.com/rhscl/perl-520-rhel7:latest

  ~ importing latest image ...
  * registry.access.redhat.com/rhscl/perl-520-rhel7@sha256:d0b7011aa1a7e961d96388ec062a0b3a03ff8e0e3225f7290f36ab8316724420
      11 seconds ago
~~~

Expected results:
- It should not display "importing latest image ...". It should display just like:

~~~
 ...
5.20
  tagged from registry.access.redhat.com/rhscl/perl-520-rhel7:latest

  * registry.access.redhat.com/rhscl/perl-520-rhel7@sha256:d0b7011aa1a7e961d96388ec062a0b3a03ff8e0e3225f7290f36ab8316724420
      3 seconds ago
~~~

Comment 1 Juan Vallejo 2017-11-29 21:42:43 UTC
Hi Kenjiro, could you provide the version of the client that you are using to reproduce this?

Thanks

Comment 2 Kenjiro Nakayama 2017-11-30 00:37:05 UTC
Hi Juan,

I have built upstream code and confirmed the issue can be produced.

  $ ./_output/local/bin/linux/amd64/oc version
  oc v3.8.0-alpha.0+a4e491d-326
  kubernetes v1.8.1+0d5291c
  features: Basic-Auth GSSAPI Kerberos SPNEGO
   
  Server https://api.ded-stage-aws.openshift.com:443
  openshift v3.6.173.0.49
  kubernetes v1.6.1+5115d708d7

Also, old oc version (e.g v3.3) can see this issue.

  # oc version
  oc v3.3.1.46.11
  kubernetes v1.3.0+52492b4
  features: Basic-Auth GSSAPI Kerberos SPNEGO
   
  Server https://knakayam-ose33-lb1.example.com:8443
  openshift v3.3.1.46.11
  kubernetes v1.3.0+52492b4

Comment 3 Juan Vallejo 2017-12-04 16:16:27 UTC
@bparees I was wondering if you had seen this happen in the past? Looking at the describer code for this [1], maybe the image does not have a spec tag / is missing a `From` tagRef?

1. https://github.com/openshift/origin/blob/master/pkg/oc/cli/describe/helpers.go#L297

Comment 4 Ben Parees 2017-12-04 16:21:09 UTC
i've only owned this component for 2 months, so "no" :)

But the issue would only happen when it *does* have a tagRef.From (the default for "importing" is false).

It seems most likely that it's an issue w/ this line:

importing = !tagRef.Reference && tagRef.Generation != nil && *tagRef.Generation != gen

we'd have to see the full yaml for an imagestream tag that's being described incorrectly to know for sure.

Comment 5 Kenjiro Nakayama 2017-12-04 16:29:44 UTC
apiVersion: v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/image.dockerRepositoryCheck: 2017-12-04T16:28:54Z
  creationTimestamp: 2017-12-04T16:28:50Z
  generation: 3
  name: perl
  namespace: demo
  resourceVersion: "4484184"
  selfLink: /oapi/v1/namespaces/demo/imagestreams/perl
  uid: 35ffaab7-d910-11e7-80df-001a4a40dc8c
spec:
  tags:
  - annotations: null
    from:
      kind: DockerImage
      name: registry.access.redhat.com/rhscl/perl-520-rhel7:latest
    generation: 2
    importPolicy: {}
    name: "5.20"
  - annotations: null
    from:
      kind: ImageStreamTag
      name: perl:5.20
    generation: 3
    importPolicy: {}
    name: latest
status:
  dockerImageRepository: 172.30.106.110:5000/demo/perl
  tags:
  - items:
    - created: 2017-12-04T16:28:54Z
      dockerImageReference: registry.access.redhat.com/rhscl/perl-520-rhel7@sha256:33943283d085d8b93dd8898f3fcc83dcbdb901deb8aef6de443c9520fd3103f8
      generation: 3
      image: sha256:33943283d085d8b93dd8898f3fcc83dcbdb901deb8aef6de443c9520fd3103f8
    tag: latest
  - items:
    - created: 2017-12-04T16:28:54Z
      dockerImageReference: registry.access.redhat.com/rhscl/perl-520-rhel7@sha256:33943283d085d8b93dd8898f3fcc83dcbdb901deb8aef6de443c9520fd3103f8
      generation: 3
      image: sha256:33943283d085d8b93dd8898f3fcc83dcbdb901deb8aef6de443c9520fd3103f8
    tag: "5.20"

Comment 6 Kenjiro Nakayama 2017-12-04 16:31:25 UTC
I provided the full yaml. But as I reported, the issue could be produced by just two commands and so you can check it by yourself.

  # oc tag registry.access.redhat.com/rhscl/perl-520-rhel7:latest perl:5.20 --source=docker
  # oc tag perl:5.20 perl:latest --source=istag --alias

Comment 7 Ben Parees 2017-12-04 16:34:52 UTC
Kenjiro we don't always have time to go setup an env to reproduce everything, that's why it's sometimes easier for us to just ask you for this information.  Thank you for providing it.

Comment 8 Ben Parees 2017-12-04 16:39:45 UTC
As i suspected the message shows up because the spec.tag[5.20] has a generation==2 and the status.tag[5.20] has generation=3.

Now *why* that occurred(and whether it should be expected), i'm not sure and will need further investigation.

Comment 9 Ben Parees 2017-12-04 16:40:45 UTC
it's possible we should just change the check to:

importing = !tagRef.Reference && tagRef.Generation != nil && *tagRef.Generation > gen

Comment 10 Ben Parees 2018-01-10 04:28:31 UTC
Corey, see comments 4, 8, and 9.  This should be a pretty straightforward fix.

Comment 11 Corey Daley 2018-01-10 11:52:11 UTC
Submitted pull request https://github.com/openshift/origin/pull/18043

Comment 13 Dongbo Yan 2018-01-23 09:35:00 UTC
Verified
# oc version
oc v3.9.0-0.22.0
kubernetes v1.9.1+a0ce1bc657
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://:8443
openshift v3.9.0-0.22.0
kubernetes v1.9.1+a0ce1bc657

# oc describe is
Name:			perl
Namespace:		dyan2
Created:		25 seconds ago
Labels:			<none>
Annotations:		openshift.io/image.dockerRepositoryCheck=2018-01-23T09:33:30Z
Docker Pull Spec:	docker-registry.default.svc:5000/dyan2/perl
Image Lookup:		local=false
Unique Images:		1
Tags:			2

latest
  tagged from perl:5.20

  * registry.access.redhat.com/rhscl/perl-520-rhel7@sha256:dda022dc2d7098e127d91ec07805c4aeeaaed7f4f12b5f20c22a9a8352cbc2f5
      25 seconds ago

5.20
  tagged from registry.access.redhat.com/rhscl/perl-520-rhel7:latest

  * registry.access.redhat.com/rhscl/perl-520-rhel7@sha256:dda022dc2d7098e127d91ec07805c4aeeaaed7f4f12b5f20c22a9a8352cbc2f5
      25 seconds ago

Comment 16 errata-xmlrpc 2018-03-28 14:13:03 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/RHBA-2018:0489


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