Add flag for ssh known hosts file
This commit is contained in:
parent
c4c68e2620
commit
933bbdfc1f
|
|
@ -73,6 +73,8 @@ var flSSHSecret = flag.String("ssh-key", envString("GIT_SSH_KEY", "/etc/git-secr
|
||||||
"the ssh key to use")
|
"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")
|
||||||
|
var flSSHKnownHostsFile = flag.String("ssh-known-hosts-file", envString("GIT_KNOWN_HOSTS_FILE", "/etc/git-secret/known_hosts"),
|
||||||
|
"the known hosts file to use")
|
||||||
|
|
||||||
var flCookieFile = flag.Bool("cookie-file", envBool("GIT_COOKIE_FILE", false),
|
var flCookieFile = flag.Bool("cookie-file", envBool("GIT_COOKIE_FILE", false),
|
||||||
"use git cookiefile")
|
"use git cookiefile")
|
||||||
|
|
@ -516,7 +518,7 @@ 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 = *flSSHSecret
|
var pathToSSHSecret = *flSSHSecret
|
||||||
var pathToSSHKnownHosts = "/etc/git-secret/known_hosts"
|
var pathToSSHKnownHosts = *flSSHKnownHostsFile
|
||||||
|
|
||||||
fileInfo, err := os.Stat(pathToSSHSecret)
|
fileInfo, err := os.Stat(pathToSSHSecret)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue