Remove unused chmod/chown abstractions

These abstractions have not been used since I first hacked into
kubernetes, so let's just remove them and add them back if it's needed
later.
This commit is contained in:
Rodrigo Campos
2017-04-23 19:11:04 -03:00
parent 35159f9c45
commit 2eb1583e4b
9 changed files with 2 additions and 186 deletions

View File

@@ -22,9 +22,6 @@ import (
"path/filepath"
"syscall"
"k8s.io/kubernetes/pkg/util/chmod"
"k8s.io/kubernetes/pkg/util/chown"
"os"
"github.com/golang/glog"
@@ -44,8 +41,6 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64) error {
return nil
}
chownRunner := chown.New()
chmodRunner := chmod.New()
return filepath.Walk(mounter.GetPath(), func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
@@ -72,7 +67,7 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64) error {
return nil
}
err = chownRunner.Chown(path, int(stat.Uid), int(*fsGroup))
err = os.Chown(path, int(stat.Uid), int(*fsGroup))
if err != nil {
glog.Errorf("Chown failed on %v: %v", path, err)
}
@@ -86,7 +81,7 @@ func SetVolumeOwnership(mounter Mounter, fsGroup *int64) error {
mask |= os.ModeSetgid
}
err = chmodRunner.Chmod(path, info.Mode()|mask)
err = os.Chmod(path, info.Mode()|mask)
if err != nil {
glog.Errorf("Chmod failed on %v: %v", path, err)
}