Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move 'path' package usage to 'path/filepath'. #87713

Merged
merged 1 commit into from Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkg/volume/csi/csi_mounter.go
Expand Up @@ -22,7 +22,6 @@ import (
"errors"
"fmt"
"os"
"path"
"path/filepath"
"strconv"

Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/volume/csi/csi_plugin.go
Expand Up @@ -20,7 +20,7 @@ import (
"errors"
"fmt"
"os"
"path"
"path/filepath"
"strings"
"time"

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down