From 933bbdfc1f1ad53eaf625d41aee09358006e95ef Mon Sep 17 00:00:00 2001 From: Thomas Jackson Date: Thu, 17 Jan 2019 14:35:23 -0800 Subject: [PATCH] Add flag for ssh known hosts file --- cmd/git-sync/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/git-sync/main.go b/cmd/git-sync/main.go index 6645e9d..c775bcf 100644 --- a/cmd/git-sync/main.go +++ b/cmd/git-sync/main.go @@ -73,6 +73,8 @@ var flSSHSecret = flag.String("ssh-key", envString("GIT_SSH_KEY", "/etc/git-secr "the ssh key to use") var flSSHKnownHosts = flag.Bool("ssh-known-hosts", envBool("GIT_KNOWN_HOSTS", true), "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), "use git cookiefile") @@ -516,7 +518,7 @@ func setupGitSSH(setupKnownHosts bool) error { log.V(1).Infof("setting up git SSH credentials") var pathToSSHSecret = *flSSHSecret - var pathToSSHKnownHosts = "/etc/git-secret/known_hosts" + var pathToSSHKnownHosts = *flSSHKnownHostsFile fileInfo, err := os.Stat(pathToSSHSecret) if err != nil {