Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#1597 from ConnorJC3/fix-umount
Browse files Browse the repository at this point in the history
Check for 'not mounted' in linux Unstage/Unpublish
  • Loading branch information
k8s-ci-robot authored May 15, 2023
2 parents 691bac1 + 7fe1031 commit 7f79b95
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pkg/driver/mount_linux.go
Original file line number Diff line number Diff line change
@@ -137,11 +137,22 @@ func (m *NodeMounter) parseFsInfoOutput(cmdOutput string, spliter string, blockS
}

func (m *NodeMounter) Unpublish(path string) error {
return m.Unmount(path)
// On linux, unpublish and unstage both perform an unmount
return m.Unstage(path)
}

func (m *NodeMounter) Unstage(path string) error {
return m.Unmount(path)
err := m.Unmount(path)
// Ignore the error when it contains "not mounted", because that indicates the
// world is already in the desired state
//
// mount-utils attempts to detect this on its own but fails when running on
// a read-only root filesystem, which our manifests use by default
if err == nil || strings.Contains(fmt.Sprint(err), "not mounted") {
return nil
} else {
return err
}
}

func (m *NodeMounter) NewResizeFs() (Resizefs, error) {

0 comments on commit 7f79b95

Please sign in to comment.