Bug 1276997

Summary: [platformmanagement_public_514]"reference" is not supported when Kind!=DockerImage in the ImageStream
Product: OKD Reporter: Wei Sun <wsun>
Component: Image RegistryAssignee: Maciej Szulik <maszulik>
Status: CLOSED NOTABUG QA Contact: Wei Sun <wsun>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-03 03:45:50 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 Wei Sun 2015-11-02 03:22:56 UTC
Description of problem:
Try to create an ImageStream when  Kind!=DockerImage, but "reference" is not supported,so if Kind!=DockerImage,then I could not create the ImageStream successfully if the json file has "reference".

Version-Release number of selected component (if applicable):
devenv-rhel7_2619

How reproducible:
Always

Steps to Reproduce:
1.Create an ImageStream named python
2.Import the image
3.Create another ImageStream named python27,but kind!=DockerImage
4.Remove the "reference":"false" from the json file

Actual results:
1.$ cat 510527.json 
{

    "kind": "ImageStream",

    "apiVersion": "v1",

    "metadata": {

      "name": "python",

      "creationTimestamp": null

    },

    "spec": {

      "dockerImageRepository": "wsun/python-33-centos"

      }

}

2.$ oc import-image python
Waiting for the import to complete, CTRL+C to stop waiting.
The import completed successfully.

Name:			python
Created:		15 seconds ago
Labels:			<none>
Annotations:		openshift.io/image.dockerRepositoryCheck=2015-11-02T02:53:00Z
Docker Pull Spec:	172.30.125.194:5000/wsuntest/python

Tag	Spec		Created		PullSpec											Image
3.3	<pushed>	14 seconds ago	wsun/python-33-centos@sha256:00ff0c67776058aaa73c9486953b3922230d4bd61544945d08a860b80a6a3a40	
latest	<pushed>	14 seconds ago	wsun/python-33-centos@sha256:354d212f9a8c776a221487f4223211103f2e0c4d42ea97eeae6091523acff3ef	

3.$ cat 27is.json 
{

    "kind": "ImageStream",
    "apiVersion": "v1",
    "metadata": {
      "name": "python27",
      "creationTimestamp": null
     },
    "spec": {
           "tags":[
                      { "name": "3.3",
                         "annotations":
                              { "description": "wsun tests" },
                          "from":
                           {
                               "Kind": "ImageStreamTag",
                                "Name": "python:3.3"
                           },
                          "reference": "false"
                        }
             ]
       }

 }

oc create -f 27is.json 
unable to load "27is.json": json: cannot unmarshal string into Go value of type bool

4.$ oc create -f 27is.json 
imagestream "python27" created

Expected results:
"reference" should be supported when kind!=DockerImage

Additional info:

Comment 1 Maciej Szulik 2015-11-02 15:16:40 UTC
This is not a bug, we're not importing anything for the 2nd time. You'll be able to observe that with https://github.com/openshift/origin/pull/5546 The reason you're seeing the info is because we resolve the ImageStreamTag into the value we've imported in the other is.