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

@@ -254,13 +254,7 @@ func (c *gitRepoVolumeUnmounter) TearDown() error {
// TearDownAt simply deletes everything in the directory.
func (c *gitRepoVolumeUnmounter) TearDownAt(dir string) error {
// 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 getVolumeSource(spec *volume.Spec) (*v1.GitRepoVolumeSource, bool) {