Bug 1534916

Summary: oc new-app with different way of parameter passing should have consistent behavior
Product: OpenShift Container Platform Reporter: shahan <hasha>
Component: BuildAssignee: Mangirdas Judeikis <mjudeiki>
Status: CLOSED DUPLICATE QA Contact: Wenjing Zheng <wzheng>
Severity: low Docs Contact:
Priority: low    
Version: 3.9.0CC: aos-bugs, bparees
Target Milestone: ---   
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: 2018-04-26 12:40:52 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 shahan 2018-01-16 09:45:38 UTC
Description of problem:
 oc new-app with the different way of parameter passing should have consistent behavior

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

oc v3.9.0-0.16.0
kubernetes v1.9.0-beta1
features: Basic-Auth GSSAPI Kerberos SPNEGO

How reproducible:
Always

Steps to Reproduce:
1. oc new-app openshift/ruby:latest~https://github.com/openshift/fakerepo.git 
2. oc new-app --image-stream=openshift/ruby:latest --code=https://github.com/openshift/fakerepo.git
3.

Actual results:
1. Could build up the components of an application successfully without GitHub user/password
2. need GitHub user/password
Expected results:
These two ways should have consistent behavior.

Additional info:

Comment 1 Ben Parees 2018-01-16 14:09:48 UTC
Since it wasn't clear to me.. the issue here is not that the app ultimately doesn't build, it's that in (1) the components of the app are successfully created (even though the repo does not exist) and in (2) the components are not created because we can't clone the repo.

MJ, I think this is related to https://bugzilla.redhat.com/show_bug.cgi?id=1470374

Comment 2 Mangirdas Judeikis 2018-01-16 14:42:24 UTC
It might be solved already. I will check and confirm.

Comment 3 Mangirdas Judeikis 2018-04-16 13:11:36 UTC
I suspect the problem root cause is similar. Its problem here: https://github.com/openshift/origin/blob/master/pkg/git/repository.go#L228

So its different issue, but same "source code detection flow".

We can work it by adding some error checking here: 
https://github.com/openshift/origin/blob/master/pkg/oc/generate/cmd/resolve.go#L264

Which would "/dev/null" errors, if they come from certain git behavior. In example:
1. No git available.
2. Remote repo is secure.

Any other errors would be threaded as normal errors and passed down the stream for proper handling. 

Overall some of the oc & git interaction should be revisited?

Comment 4 Mangirdas Judeikis 2018-04-16 13:17:52 UTC
doing a small bugfix, which might solve this too https://bugzilla.redhat.com/show_bug.cgi?id=1470374

Comment 5 Ben Parees 2018-04-26 12:40:52 UTC

*** This bug has been marked as a duplicate of bug 1470374 ***