From 6156d144f2efeba4df6b2c211de6dbc629cf34d0 Mon Sep 17 00:00:00 2001 From: Ratnadeep Debnath Date: Thu, 27 Oct 2016 17:09:14 +0530 Subject: [PATCH] Fix generating project source repo URL in openshift buildconfig. --- pkg/transformer/openshift/openshift.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/transformer/openshift/openshift.go b/pkg/transformer/openshift/openshift.go index b4793730..47b3000a 100644 --- a/pkg/transformer/openshift/openshift.go +++ b/pkg/transformer/openshift/openshift.go @@ -83,7 +83,13 @@ func getGitRemote(remote string) string { if err != nil { return "" } - return strings.TrimRight(string(out), "\n") + url := strings.TrimRight(string(out), "\n") + + if !strings.HasSuffix(url, ".git") { + url += ".git" + } + + return url } // getAbsBuildContext returns build context relative to project root dir