Check if pathExists before performing Unmount

This commit is contained in:
rkouj
2016-12-29 14:48:50 -08:00
parent c7063fd6c0
commit 8cec46e8ca
7 changed files with 34 additions and 32 deletions

View File

@@ -272,14 +272,7 @@ func (c *downwardAPIVolumeUnmounter) TearDown() error {
}
func (c *downwardAPIVolumeUnmounter) TearDownAt(dir string) error {
glog.V(3).Infof("Tearing down volume %v for pod %v at %v", c.volName, c.podUID, dir)
// Wrap EmptyDir, let it do the teardown.
wrapped, err := c.plugin.host.NewWrapperUnmounter(c.volName, wrappedVolumeSpec(), c.podUID)
if err != nil {
return err
}
return wrapped.TearDownAt(dir)
return volume.UnmountViaEmptyDir(dir, c.plugin.host, c.volName, wrappedVolumeSpec(), c.podUID)
}
func (b *downwardAPIVolumeMounter) getMetaDir() string {