Bug 1259260 - --search with multiple options doesn't get right search result
--search with multiple options doesn't get right search result
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
Yan Du
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-02 06:04 EDT by Yanping Zhang
Modified: 2015-11-23 16:18 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 16:18:42 EST
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)

  None (edit)
Description Yanping Zhang 2015-09-02 06:04:26 EDT
Description of problem:
When run new-app --search with multiple options, such as "oc new-app --search --image-stream=php --docker-image=mysl  --template=ruby", if have matched image-stream or template, but have not matched docker-image, the output shows error info directly. It should list the matched image-stream/template.

Version-Release number of selected component (if applicable):
client latest oc version:
oc v1.0.5-134-g01b410a
kubernetes v1.1.0-alpha.0-1605-g44c91b1

Server ose 3.0.1:
 oc version
oc v3.0.1.0-528-g8c2fe51
kubernetes v1.0.0

How reproducible:
Always

Steps to Reproduce:
1.Login with common user, and create template and image stream in project
$oc create -f origin/examples/sample-app/application-template-stibuild.json
$oc create -f origin/examples/image-streams/image-streams-centos7.json

2.Get template/image streams in project
$oc get template |grep ruby
$oc get is |grep php

3.Search with multiple options template/image-stream/docker-image in project
$ oc new-app --search --image-stream=php   --template=ruby --docker-image=mysl
3.

Actual results:
2. 
$ oc get template |grep ruby
ruby-helloworld-sample   This example shows how to create a simple ruby application in openshift origi...   5 (4 generated)   8
 oc get is |grep php
php                  pro1/php-55-centos7                       5.5,latest    45 seconds ago


3.$ oc new-app --search --image-stream=php   --template=ruby --docker-image=mysl
error: no image or template matched "mysl": the default tag "latest" has not been set on repository "library/mysl"


Expected results:

3.Shoule show image-stream for php and template ruby-hello-world


Additional info:
When test on fedora_devenv_2260, when there is no matched docker image, it could output the matched image stream and template

$  oc new-app --search --docker-image=esdpp --template=mysql --image-stream=php  -n pro1
Templates (oc new-app --template=<template>)
-----
mysql-persistent
  Project: pro1
  MySQL database service, with persistent storage. Scaling to more than one replica is not supported

Image streams (oc new-app --image-stream=<image-stream> [--code=<source>])
-----
php
  Project: pro1
  Tracks:  openshift/php-55-centos7
  Tags:    5.5,latest
Comment 1 Yanping Zhang 2015-09-08 04:04:57 EDT
Do negative test on --doccker-image, found when ran on a local client, the result was different from ran on the server directly, though the oc version is the same.
Run on local client:
# oc new-app --search=true --docker-image=fsfsfs -n prozyp
error: no image or template matched "fsfsfs": the default tag "latest" has not been set on repository "library/fsfsfs"
Run on server:
# oc new-app --search=true --docker-image=fsfsfs -n prozyp
error: no matches found

The output from the local client is not the expected.
Comment 2 Fabiano Franz 2015-09-30 13:45:11 EDT
This is fixed in master:

$ oc new-app --search --image-stream=php  --template=ruby --docker-image=mysl
Templates (oc new-app --template=<template>)
-----
ruby-helloworld-sample
  Project: test1
  This example shows how to create a simple ruby application in openshift origin v3

Image streams (oc new-app --image-stream=<image-stream> [--code=<source>])
-----
php
  Project: test1
  Tracks:  openshift/php-55-centos7
  Tags:    5.5,latest
Comment 3 Yanping Zhang 2015-10-08 01:23:20 EDT
Tested on devenv-fedora_2444
$ oc version
oc v1.0.6-328-gdf1f19e
kubernetes v1.1.0-alpha.1-653-g86b4e77

Client oc version:
oc v1.0.6-328-gdf1f19e
kubernetes v1.1.0-alpha.1-653-g86b4e77

Steps to test:
1.Login with common user on a local client and create image streams and template in project.
$ oc create -f application-template-stibuild.json -n protest
$ oc create -f image-streams-centos7.json -n protest

2.Search with multiple options on the client.
$ oc new-app --search --docker-image=fs --template=ruby --image-stream=ruby -n protest
error: no image or template matched "fs": the default tag "latest" has not been set on repository "library/fs"

3.Search with multiple options on the master server.
$ oc new-app --search --docker-image=fs --template=ruby --image-stream=ruby -n protest
Templates (oc new-app --template=<template>)
-----
ruby-helloworld-sample
  Project: protest
  This example shows how to create a simple ruby application in openshift origin v3

Image streams (oc new-app --image-stream=<image-stream> [--code=<source>])
-----
ruby
  Project: protest
  Tracks:  openshift/ruby-20-centos7
  Tags:    2.0,latest


From the output of step 2, it still couldn't get the right search result when run the command on local client.
Comment 4 Fabiano Franz 2015-10-15 14:43:21 EDT
Sorry, I didn't notice it was only related to a remote registry (not local client). Should be fixed in https://github.com/openshift/origin/pull/5147
Comment 5 openshift-github-bot 2015-10-15 22:04:38 EDT
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/331be46d61c2f4711801d22cfe5390c23d5b91a6
Bug 1259260 - when searching docker registry, should not exit in case of no matches
Comment 6 Yanping Zhang 2015-10-16 00:29:09 EDT
Checked on the latest origin code, the issue is fixed.
oc v1.0.6-638-g68a7d7b
kubernetes v1.1.0-alpha.1-653-g86b4e77

Searching on remote client could get right results now:
$ ./oc new-app --search --docker-image=fs --template=ruby --image-stream=ruby
Templates (oc new-app --template=<template>)
-----
ruby-helloworld-sample
  Project: prozyp
  This example shows how to create a simple ruby application in openshift origin v3

Image streams (oc new-app --image-stream=<image-stream> [--code=<source>])
-----
ruby-20-centos7
  Project: prozyp
  Tracks:  openshift/ruby-20-centos7
  Tags:    latest
origin-ruby-sample
  Project: prozyp
  Tracks:  
  Tags:    <none>

Move the bug to Verified.

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