Merge pull request #73488 from andrewsykim/replace-utils-file

Replace pkg/util/file with k8s.io/utils/path
This commit is contained in:
Kubernetes Prow Robot
2019-01-30 17:50:16 -08:00
committed by GitHub
55 changed files with 470 additions and 476 deletions

View File

@@ -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",
],
)

View File

@@ -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 {