mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #87713 from kkmsft/filepath-fixes-windows
Move 'path' package usage to 'path/filepath'.
This commit is contained in:
commit
76c89645c5
@ -22,7 +22,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
||||
@ -432,7 +431,7 @@ func removeMountDir(plug *csiPlugin, mountPath string) error {
|
||||
return errors.New(log("failed to remove dir [%s]: %v", mountPath, err))
|
||||
}
|
||||
// remove volume data file as well
|
||||
volPath := path.Dir(mountPath)
|
||||
volPath := filepath.Dir(mountPath)
|
||||
dataFile := filepath.Join(volPath, volDataFileName)
|
||||
klog.V(4).Info(log("also deleting volume info data file [%s]", dataFile))
|
||||
if err := os.Remove(dataFile); err != nil && !os.IsNotExist(err) {
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -387,7 +387,7 @@ func (p *csiPlugin) NewMounter(
|
||||
|
||||
// Save volume info in pod dir
|
||||
dir := mounter.GetPath()
|
||||
dataDir := path.Dir(dir) // dropoff /mount at end
|
||||
dataDir := filepath.Dir(dir) // dropoff /mount at end
|
||||
|
||||
if err := os.MkdirAll(dataDir, 0750); err != nil {
|
||||
return nil, errors.New(log("failed to create dir %#v: %v", dataDir, err))
|
||||
@ -438,7 +438,7 @@ func (p *csiPlugin) NewUnmounter(specName string, podUID types.UID) (volume.Unmo
|
||||
|
||||
// load volume info from file
|
||||
dir := unmounter.GetPath()
|
||||
dataDir := path.Dir(dir) // dropoff /mount at end
|
||||
dataDir := filepath.Dir(dir) // dropoff /mount at end
|
||||
data, err := loadVolumeData(dataDir, volDataFileName)
|
||||
if err != nil {
|
||||
return nil, errors.New(log("unmounter failed to load volume data file [%s]: %v", dir, err))
|
||||
|
Loading…
Reference in New Issue
Block a user