Bug 1447495 - [dY8fPwNo] 'new-app' should respect PR ref when create a docker app
Summary: [dY8fPwNo] 'new-app' should respect PR ref when create a docker app
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Build
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.x
Assignee: Gabe Montero
QA Contact: Wenjing Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-03 02:12 UTC by XiuJuan Wang
Modified: 2017-09-12 14:20 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Several git related, client side, paths in the `oc` command were executing `git clone` and then assuming `git checkout` would work without a preceding `git fetch` when a PR reference was used. Consequence: the `git checkout` would fail Fix: before exiting the `oc` command, on a `git checkout` failure, go back and try a `git fetch` then `git checkout` sequence and see if that works. Result: various `oc` operations should succeed when PR refs are used during git operations.
Clone Of:
Environment:
Last Closed: 2017-09-12 14:20:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description XiuJuan Wang 2017-05-03 02:12:11 UTC
Description of problem:
Failed to create an app with dockerstrategy with PR ref

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

oc v3.6.0-alpha.1+85b8686-354
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://172.18.15.51:8443
openshift v3.6.0-alpha.1+85b8686-354
kubernetes v1.6.1+5115d708

How reproducible:
always

Steps to Reproduce:
1.Create an app with dockerstrategy with PR ref
#oc new-app https://github.com/openshift/ruby-hello-world#refs/pull/58/head

2.
3.

Actual results:
#oc new-app https://github.com/openshift/ruby-hello-world#refs/pull/58/head
error: unable to checkout ref "refs/pull/58/head" in "https://github.com/openshift/ruby-hello-world" repository: error: pathspec 'refs/pull/58/head' did not match any file(s) known to git.

Expected results:
Should create app and do build successfully

Additional info:

Comment 1 Gabe Montero 2017-05-03 14:41:36 UTC
PR https://github.com/openshift/origin/pull/14025 contains the proposed fix for this defect

Comment 2 openshift-github-bot 2017-05-08 02:15:19 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/b944e487b484632e04bcefce7a89227faa4855bf
openshift-build: enable pr fetch from oc new-app, start-build, source lookup

Bug 1447495
Bugzilla link https://bugzilla.redhat.com/show_bug.cgi?id=1447495
Detailed explanation
Several git related, client side paths, in the `oc` command were
executing `git clone` and then assuming `git checkout` would work
without a preceding `git fetch` when a PR reference is used.

Comment 3 XiuJuan Wang 2017-05-10 05:48:40 UTC
Can't reproduce this bug, thanks.

Verified with server as below
oc v3.6.74
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://***:8443
openshift v3.6.74
kubernetes v1.6.1+5115d708d7


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