Skip to content

Commit

Permalink
bugfix: fix repo username when image building (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Jul 23, 2020
1 parent f52a97d commit 3d7e187
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -53,8 +54,12 @@ func (g *GitScm) SourceCode(ctx context.Context, repository, path, revision stri
return signErr
}
splitRepo := strings.Split(repository, "@")
user, parseErr := url.Parse(splitRepo[0])
if parseErr != nil {
return parseErr
}
auth := &gitssh.PublicKeys{
User: splitRepo[0],
User: user.Host,
Signer: signer,
HostKeyCallbackHelper: gitssh.HostKeyCallbackHelper{
HostKeyCallback: ssh.InsecureIgnoreHostKey(), // nolint
Expand Down

0 comments on commit 3d7e187

Please sign in to comment.