diff --git a/cmd/git-sync/main.go b/cmd/git-sync/main.go index 0df6d04..6645e9d 100644 --- a/cmd/git-sync/main.go +++ b/cmd/git-sync/main.go @@ -69,6 +69,8 @@ var flPassword = flag.String("password", envString("GIT_SYNC_PASSWORD", ""), var flSSH = flag.Bool("ssh", envBool("GIT_SYNC_SSH", false), "use SSH for git operations") +var flSSHSecret = flag.String("ssh-key", envString("GIT_SSH_KEY", "/etc/git-secret/ssh"), + "the ssh key to use") var flSSHKnownHosts = flag.Bool("ssh-known-hosts", envBool("GIT_KNOWN_HOSTS", true), "enable SSH known_hosts verification") @@ -513,7 +515,7 @@ func setupGitAuth(username, password, gitURL string) error { func setupGitSSH(setupKnownHosts bool) error { log.V(1).Infof("setting up git SSH credentials") - var pathToSSHSecret = "/etc/git-secret/ssh" + var pathToSSHSecret = *flSSHSecret var pathToSSHKnownHosts = "/etc/git-secret/known_hosts" fileInfo, err := os.Stat(pathToSSHSecret)