Skip to content

Conversation

@jaskiratsingh98
Copy link

Make NodeUnpublishVolume idempotent by only removing the mount if one exists.

What this PR does / why we need it:
The goal is to make NodeUnpublishVolume idempotent as required by the CSI spec. Previously, if a mount was already removed, this call would fail and would ultimately be re-queued. This would, for example, lead to pods getting stuck in a Terminating state."

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

NodeUnpublishVolume is now idempotent by ensuring a mount exists before trying to unmount.

@kubevirt-bot kubevirt-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 24, 2025
@kubevirt-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign awels for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot requested a review from awels October 24, 2025 18:40
@kubevirt-bot kubevirt-bot added the dco-signoff: no Indicates the PR's author has not DCO signed all their commits. label Oct 24, 2025
@kubevirt-bot
Copy link

Hi @jaskiratsingh98. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Make NodeUnpublishVolume idempotent by only removing the mount if one
exists.

Signed-off-by: Jaskirat Singh <[email protected]>
@jaskiratsingh98 jaskiratsingh98 force-pushed the node-unpublish-idempotency branch from cec769b to 7cd7c19 Compare October 28, 2025 18:12
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Oct 28, 2025
Copy link
Collaborator

@akalenyu akalenyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just tackling this too in #165, but apparently it is solved by using the proper mount utils library -

if withSafeNotMountedBehavior && strings.Contains(string(output), errNotMounted) {
klog.V(4).Infof("ignoring 'not mounted' error for %s", target)
return nil
}
(on most distros)

In which version are you seeing this? we could still ofc do better with the cleanup API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants