Skip to content

Commit

Permalink
Merge pull request #16187 from coreydaley/bugzilla_1488283_new_app_do…
Browse files Browse the repository at this point in the history
…esnt_respect_git_proxy

Automatic merge from submit-queue

oc new-app should not time out while using a proxy

the oc new-app command should not time out while
    checking if the supplied source repository requires
    authentication.

Bugzilla: [link](https://bugzilla.redhat.com/show_bug.cgi?id=1488283)
  • Loading branch information
openshift-merge-robot committed Sep 12, 2017
2 parents 7f5230c + 3986427 commit 7ddd016
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/generate/app/sourcelookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"path/filepath"
"runtime"
"strings"
"time"

"github.com/docker/docker/builder/dockerfile/parser"
"github.com/golang/glog"
Expand Down Expand Up @@ -277,6 +278,7 @@ func (r *SourceRepository) LocalPath() (string, error) {
// 3) GIT_CONFIG_NOSYSTEM prevents git from loading system-wide config
// 4) GIT_ASKPASS to prevent git from prompting for a user/password
func (r *SourceRepository) DetectAuth() error {

url, ok, err := r.RemoteURL()
if err != nil {
return err
Expand Down Expand Up @@ -306,8 +308,10 @@ func (r *SourceRepository) DetectAuth() error {
fmt.Sprintf("SystemRoot=%s", os.Getenv("SystemRoot")),
)
}

gitRepo := git.NewRepositoryWithEnv(env)
_, err = CloneAndCheckoutSources(gitRepo, url.StringNoFragment(), url.URL.Fragment, tempSrc, "")
glog.V(4).Infof("Checking if %v requires authentication", url.StringNoFragment())
_, _, err = gitRepo.TimedListRemote(10*time.Second, url.StringNoFragment(), "--heads")
if err != nil {
r.requiresAuth = true
}
Expand Down

0 comments on commit 7ddd016

Please sign in to comment.