mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
pkg/terminal: use c/storage/pkg/homedir
This also prunes the dependency on `k8s.io/client-go`. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user