Bug 1384936

Summary: oc import returns success while it fails when using private registry
Product: OpenShift Container Platform Reporter: Jaspreet Kaur <jkaur>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.0CC: aos-bugs, jkaur, jokerman, mfojtik, mmccomas, pweil
Target Milestone: ---Flags: maszulik: needinfo? (jkaur)
mfojtik: needinfo? (jkaur)
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-02-02 13:58:17 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:

Description Jaspreet Kaur 2016-10-14 11:45:44 UTC
Description of problem: When trying to perform oc import it returns success while it fails as below  :


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


How reproducible:


Steps to Reproduce:
1. oc import-image chat2:1.2.9 --from='<registry:5000>' --confirm --insecure
The import completed successfully.

Name:                   chat2
Created:                Less than a second ago
Labels:                 <none>
Annotations:            openshift.io/image.dockerRepositoryCheck=2016-10-11T21:30:58Z
Docker Pull Spec:       172.31.31.176:5000/test/chat2

Tag     Spec                            Created                 PullSpec        Image
1.2.9   <registry>  Less than a second ago                  import failed: you may not have access to the Docker image "yagi.cf...

  ! tag is insecure and can be imported over HTTP or self-signed HTTPS
----https://github.com/openshift/origin/issues/8485
2. Even creating the imagestream explicitly doesn't help.
3.

Actual results: Returns sucess while it fails to import tags

Expected results: Imagestream should be created successfully and without any error using the simple import command 



Additional info: https://github.com/openshift/origin/issues/8485

Comment 1 Maciej Szulik 2016-10-20 12:22:26 UTC
Jaspreet I've just tried what you've described in the issue replacing <registry:5000> with an image from a OpenShift registry, iow:

oc import-image py3:3.5 --from=172.30.227.15:5000/openshift/python:3.5 --confirm --insecure 

That worked perfectly fine. With that in mind, can you provide me with following information:

1. openshift version
2. what <registry:5000> is in your case?
3. is it possible that <registry:5000> requires additional auth?
4. can you provide me with master logs with loglevel at least 5 (or 8 preferred) 

Best option is to provide a working reproducer that I can test against and work on a fix. 

As a final note, I'm using latest master [1]


[1] https://github.com/openshift/origin/commit/7405f1754e53b97b99e7a2649352133386aa4ac8

Comment 2 Maciej Szulik 2016-11-02 12:58:27 UTC
Additionally, the log message: 

Import failed: you may not have access to the Docker image "yagi.cf...

suggests you need authentication against the remote registry, in which case you should follow these guides:

https://docs.openshift.org/latest/dev_guide/managing_images.html#private-registries

Comment 3 Maciej Szulik 2016-11-02 13:07:22 UTC
I forgot to add I've verified the steps from linked doc on v3.2.2.1-1-ge37a755 without any problems.

Comment 4 Michal Fojtik 2017-02-01 10:02:32 UTC
Is this still a problem or we can close this bug?