mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-22 06:59:03 +00:00
Merge pull request #73488 from andrewsykim/replace-utils-file
Replace pkg/util/file with k8s.io/utils/path
This commit is contained in:
@@ -22,10 +22,10 @@ go_library(
|
||||
importpath = "k8s.io/kubernetes/pkg/master/tunneler",
|
||||
deps = [
|
||||
"//pkg/ssh:go_default_library",
|
||||
"//pkg/util/file:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/clock:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library",
|
||||
"//vendor/k8s.io/klog:go_default_library",
|
||||
"//vendor/k8s.io/utils/path:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
|
@@ -31,7 +31,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/klog"
|
||||
"k8s.io/kubernetes/pkg/ssh"
|
||||
utilfile "k8s.io/kubernetes/pkg/util/file"
|
||||
utilpath "k8s.io/utils/path"
|
||||
)
|
||||
|
||||
type InstallSSHKey func(ctx context.Context, user string, data []byte) error
|
||||
@@ -119,7 +119,7 @@ func (c *SSHTunneler) Run(getAddresses AddressFunc) {
|
||||
|
||||
// public keyfile is written last, so check for that.
|
||||
publicKeyFile := c.SSHKeyfile + ".pub"
|
||||
exists, err := utilfile.FileExists(publicKeyFile)
|
||||
exists, err := utilpath.Exists(utilpath.CheckFollowSymlink, publicKeyFile)
|
||||
if err != nil {
|
||||
klog.Errorf("Error detecting if key exists: %v", err)
|
||||
} else if !exists {
|
||||
@@ -208,7 +208,7 @@ func generateSSHKey(privateKeyfile, publicKeyfile string) error {
|
||||
}
|
||||
// If private keyfile already exists, we must have only made it halfway
|
||||
// through last time, so delete it.
|
||||
exists, err := utilfile.FileExists(privateKeyfile)
|
||||
exists, err := utilpath.Exists(utilpath.CheckFollowSymlink, privateKeyfile)
|
||||
if err != nil {
|
||||
klog.Errorf("Error detecting if private key exists: %v", err)
|
||||
} else if exists {
|
||||
|
Reference in New Issue
Block a user