From 0cb0ab2de756064adb737ba14758a9a3ed5859ee Mon Sep 17 00:00:00 2001 From: linyouchong Date: Fri, 20 Oct 2017 18:30:50 +0800 Subject: [PATCH] Remove redundant code of checking path --- pkg/volume/util.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/pkg/volume/util.go b/pkg/volume/util.go index afd28aa8f34..14962f4abde 100644 --- a/pkg/volume/util.go +++ b/pkg/volume/util.go @@ -36,7 +36,6 @@ import ( "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/sets" - volutil "k8s.io/kubernetes/pkg/volume/util" ) type RecycleEventRecorder func(eventtype, message string) @@ -424,13 +423,6 @@ func getPVCNameHashAndIndexOffset(pvcName string) (hash uint32, index uint32) { func UnmountViaEmptyDir(dir string, host VolumeHost, volName string, volSpec Spec, podUID types.UID) error { glog.V(3).Infof("Tearing down volume %v for pod %v at %v", volName, podUID, dir) - if pathExists, pathErr := volutil.PathExists(dir); pathErr != nil { - return fmt.Errorf("Error checking if path exists: %v", pathErr) - } else if !pathExists { - glog.Warningf("Warning: Unmount skipped because path does not exist: %v", dir) - return nil - } - // Wrap EmptyDir, let it do the teardown. wrapped, err := host.NewWrapperUnmounter(volName, volSpec, podUID) if err != nil {