Move SSH key path to a flag
This commit is contained in:
parent
1c3af08207
commit
c4c68e2620
|
|
@ -69,6 +69,8 @@ var flPassword = flag.String("password", envString("GIT_SYNC_PASSWORD", ""),
|
||||||
|
|
||||||
var flSSH = flag.Bool("ssh", envBool("GIT_SYNC_SSH", false),
|
var flSSH = flag.Bool("ssh", envBool("GIT_SYNC_SSH", false),
|
||||||
"use SSH for git operations")
|
"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),
|
var flSSHKnownHosts = flag.Bool("ssh-known-hosts", envBool("GIT_KNOWN_HOSTS", true),
|
||||||
"enable SSH known_hosts verification")
|
"enable SSH known_hosts verification")
|
||||||
|
|
||||||
|
|
@ -513,7 +515,7 @@ func setupGitAuth(username, password, gitURL string) error {
|
||||||
func setupGitSSH(setupKnownHosts bool) error {
|
func setupGitSSH(setupKnownHosts bool) error {
|
||||||
log.V(1).Infof("setting up git SSH credentials")
|
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"
|
var pathToSSHKnownHosts = "/etc/git-secret/known_hosts"
|
||||||
|
|
||||||
fileInfo, err := os.Stat(pathToSSHSecret)
|
fileInfo, err := os.Stat(pathToSSHSecret)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue