Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#226 from openshift-cherrypick-robo…
Browse files Browse the repository at this point in the history
…t/cherry-pick-225-to-release-4.12

[release-4.12] OCPBUGS-14281: Volume unmount repeats after successful unmount, preventing pod delete
  • Loading branch information
openshift-merge-robot authored Jun 2, 2023
2 parents 1584117 + 3bd64e9 commit 86fc1cd
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
Expand Up @@ -150,11 +150,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 := mountutils.CleanupMountPoint(path, m, false)
// 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) {
Expand Down

0 comments on commit 86fc1cd

Please sign in to comment.