From 320df838810cbdb0f3dc0e2092f5ed04fc9b6e5d Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Thu, 25 Feb 2021 20:15:03 +0100 Subject: pkg/terminal: use c/storage/pkg/homedir This also prunes the dependency on `k8s.io/client-go`. Signed-off-by: Valentin Rothberg --- pkg/terminal/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/terminal') diff --git a/pkg/terminal/util.go b/pkg/terminal/util.go index 231b47974..04e12f6b3 100644 --- a/pkg/terminal/util.go +++ b/pkg/terminal/util.go @@ -10,11 +10,11 @@ import ( "path/filepath" "sync" + "github.com/containers/storage/pkg/homedir" "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/knownhosts" "golang.org/x/crypto/ssh/terminal" - "k8s.io/client-go/util/homedir" ) var ( @@ -105,7 +105,7 @@ func ReadLogin() []byte { func HostKey(host string) ssh.PublicKey { // parse OpenSSH known_hosts file // ssh or use ssh-keyscan to get initial key - knownHosts := filepath.Join(homedir.HomeDir(), ".ssh", "known_hosts") + knownHosts := filepath.Join(homedir.Get(), ".ssh", "known_hosts") fd, err := os.Open(knownHosts) if err != nil { logrus.Error(err) -- cgit v1.2.3-54-g00ecf