Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1419801 - 'new-app' and 'new-build' should tolerate adding a tag to the existing imagestream
'new-app' and 'new-build' should tolerate adding a tag to the existing images...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build (Show other bugs)
3.5.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.8.0
Assigned To: Gabe Montero
XiuJuan Wang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-02-07 00:47 EST by XiuJuan Wang
Modified: 2018-03-28 10:05 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: oc new-app/new-build code did not honor existing images streams when generating the list of objects to be created as part of processing a template; also, as part of processing input and output images, stack overflows as a result of circular references were possibly Consequence: Either imagestream already exists or stack overflow errors would occur on `oc new-app` or `oc new-build` Fix: code changes to the `oc new-app/new-build` paths were updated to looks for existing images streams and better deal with circular references Result: oc new-app/new-build work as expected.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-03-28 10:05:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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 10:05 EDT

  None (edit)
Description XiuJuan Wang 2017-02-07 00:47:57 EST
Description of problem:
When add a tag to the existing imagestream, 'new-app' and 'new-build' should respect this situation

Version-Release number of selected component (if applicable):
oc v3.5.0.17+c55cf2b

How reproducible:
always

Steps to Reproduce:
1.Use same name for input and output image, but different tag
#oc  new-app  ruby-ex:2.0 https://github.com/openshift/ruby-ex.git

2.‘new-build’
#oc  new-build  ruby-ex:2.0 https://github.com/openshift/ruby-ex.git

3.

Actual results:
Will prompt error.
#oc  new-app  ruby-ex:2.0 https://github.com/openshift/ruby-ex.git
--> Creating resources ...
    error: imagestreams "ruby-ex" already exists

Expected results:
Should tolerate adding a tag to the existing imagestream

Additional info:
Comment 1 Ben Parees 2017-08-28 15:07:30 EDT
work in progress PR for this:
https://github.com/openshift/origin/pull/13848
Comment 2 Ben Parees 2017-10-09 16:50:01 EDT
Gabe, the above PR got this pretty far along but has probably bit-rotted, you may just want to review it to get an idea of the direction Ryan was headed in with it.

The general idea is that if new-app is going to create an imagestream name that already exists, it should instead just create a tag within that imagestream.
Comment 3 Gabe Montero 2017-10-10 14:22:14 EDT
Ben - first, just noting I had to change the repro steps here slightly to see anything like this, and still have a few questions.

1) If I literally tried `oc  new-app  ruby-ex:2.0 https://github.com/openshift/ruby-ex.git` I got:

error: Errors occurred while determining argument types:

ruby-ex:2.0 as a Git repository URL:  ssh: Could not resolve hostname ruby-ex: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ruby-ex:2.0 as a local directory pointing to a Git repository:  stat ruby-ex:2.0: no such file or directory

Errors occurred during resource creation:
error: no match for "ruby-ex:2.0"


2) thinking the images streams might have changed names, I then ran `oc new-app --list` and saw this for ruby:

ruby
  Project: openshift
  Tags:    2.2, 2.3, 2.4, latest


so I switched to `oc new-app ruby:2.2 https://github.com/openshift/ruby-ex.git` and that worked successfully.

3) I then tried `oc new-app ruby:2.3 https://github.com/openshift/ruby-ex.git` and it complained about ruby-ex existing.

Questions:
a) is this the intended flow? ... the PR also denotes a slightly different permutation, though I think it results in the same root cause/effect
b) the new-app in 3) also complained about duplicate buildconfigs. deploymentconfigs, and services ... I saw some discussion of this with Clayton in the PR, but am not sure I saw a consensus reached ... where do you want the initial stake in the new PR to be? ... more general/holistic, or image specific?
Comment 4 Ben Parees 2017-10-10 14:48:31 EDT
a) yes.  I think the recreate may have left out a step, or used the wrong name, but your recreate shows the issue.

b) image specific.  Namely, that if the imagestreamtag we are about to try to create, already exists and points to the same place as the one we are about to try to create, then it's ok not to create it.  And if the imagestream exists, but not the tag, it's ok to create the tag within the imagestream instead of failing because we can't create the imagestream.

The critical problem to solve here is the one described in
https://github.com/openshift/origin/issues/13169
Comment 5 Gabe Montero 2017-10-12 14:44:19 EDT
New PR is https://github.com/openshift/origin/pull/16843
Comment 6 Gabe Montero 2017-11-10 14:21:54 EST
Quick update: the PR has been marked for merge, just waiting for the 3.7 induced lockdown of openshit/origin:master to be lifted.
Comment 7 Gabe Montero 2017-11-14 09:22:44 EST
PR merged .... moving to modified
Comment 9 XiuJuan Wang 2018-01-03 03:39:30 EST
1.Create a is 
$oc import-image ruby-ex:test --from='openshift/ruby-22-centos7' --confirm

2.Create app which will create above same is 
$oc  new-app  ruby:2.3  https://github.com/openshift/ruby-ex.git
or 
$oc  new-build  ruby:2.3  https://github.com/openshift/ruby-ex.git

same imagestream with different tag will be create successfully

3.Check is
 oc get  is 
NAME      DOCKER REPO                                     TAGS          UPDATED
ruby-ex   docker-registry.default.svc:5000/xiu1/ruby-ex   latest,test   18 seconds ago

Verified this bug in openshift cluster & client v3.9.0-0.9.0
Comment 11 Gabe Montero 2018-02-21 10:09:51 EST
The fix has been verified by QE and is currently targeted for the 3.9 release.
Comment 14 errata-xmlrpc 2018-03-28 10:05:01 EDT
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.