Update golang dependencies

This commit is contained in:
Manuel de Brito Fontes 2017-05-20 20:11:38 -04:00
parent c5e30973e5
commit 9ddf98769a
1009 changed files with 175867 additions and 50378 deletions

View file

@ -22,11 +22,10 @@ import (
"path/filepath"
"syscall"
"k8s.io/kubernetes/pkg/util/chmod"
"k8s.io/kubernetes/pkg/util/chown"
"os"
"k8s.io/apimachinery/pkg/types"
"github.com/golang/glog"
)
@ -38,14 +37,12 @@ const (
// SetVolumeOwnership modifies the given volume to be owned by
// fsGroup, and sets SetGid so that newly created files are owned by
// fsGroup. If fsGroup is nil nothing is done.
func SetVolumeOwnership(mounter Mounter, fsGroup *int64) error {
func SetVolumeOwnership(mounter Mounter, fsGroup *types.UnixGroupID) error {
if fsGroup == nil {
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 +69,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 +83,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)
}