1
0
mirror of synced 2026-02-07 11:15:57 +00:00

Work around custom client domain issue

With this commit comes a lot of evil.

Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
Hidde Beydals
2021-03-30 16:58:10 +02:00
parent ef576128e3
commit e65a5beaae
2 changed files with 15 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import (
"io/ioutil"
"os"
"regexp"
"strings"
"time"
"github.com/go-git/go-git/v5/plumbing/transport/http"
@@ -144,6 +145,12 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
Hostname: gitlabArgs.hostname,
Token: glToken,
}
// Workaround for: https://github.com/fluxcd/go-git-providers/issues/55
if hostname := providerCfg.Hostname; hostname != glDefaultDomain &&
!strings.HasPrefix(hostname, "https://") &&
!strings.HasPrefix(hostname, "http://") {
providerCfg.Hostname = "https://" + providerCfg.Hostname
}
providerClient, err := provider.BuildGitProvider(providerCfg)
if err != nil {
return err