Skip to content

Commit

Permalink
Merge pull request #39690 from jingxu97/automated-cherry-pick-of-#389…
Browse files Browse the repository at this point in the history
…09-upstream-release-1.4

Automated cherry pick of #38909
  • Loading branch information
jessfraz committed Jan 11, 2017
2 parents 6f80bba + f87d9fa commit a5e8b37
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/kubelet/kubelet_getters.go
Expand Up @@ -30,6 +30,7 @@ import (
"k8s.io/kubernetes/pkg/types"
"k8s.io/kubernetes/pkg/util"
nodeutil "k8s.io/kubernetes/pkg/util/node"
volumeutil "k8s.io/kubernetes/pkg/volume/util"
)

// getRootDir returns the full path to the directory under which kubelet can
Expand Down Expand Up @@ -244,6 +245,14 @@ func (kl *Kubelet) GetExtraSupplementalGroupsForPod(pod *api.Pod) []int64 {
func (kl *Kubelet) getPodVolumePathListFromDisk(podUID types.UID) ([]string, error) {
volumes := []string{}
podVolDir := kl.getPodVolumesDir(podUID)

if pathExists, pathErr := volumeutil.PathExists(podVolDir); pathErr != nil {
return volumes, fmt.Errorf("Error checking if path %q exists: %v", podVolDir, pathErr)
} else if !pathExists {
glog.Warningf("Warning: path %q does not exist: %q", podVolDir)
return volumes, nil
}

volumePluginDirs, err := ioutil.ReadDir(podVolDir)
if err != nil {
glog.Errorf("Could not read directory %s: %v", podVolDir, err)
Expand Down

0 comments on commit a5e8b37

Please sign in to comment.