Skip to content

Conversation

@navinms711
Copy link
Contributor

@navinms711 navinms711 commented Dec 18, 2025

Summary

This PR addresses the issue describe in https://vmw-jira.broadcom.net/browse/TNZ-71700. Following changes are made:

(1) One new custom error type MountPointNotExistError for wrapping os.ErrNotExist() error.
(2) Two new private methods removeMountPath() and decrementMountCount on VolumeDriver. This removes code duplication in many places.
(3) Will any of the callers fail because of error wrapping? No.
(4) New unit tests are added.

Summary of Error code Paths
-------------------------------------------------------------------------------------------------------
Error Path                              Mount Count decremented ?      Error Preserved ?
                                        BEFORE  |   AFTER              BEFORE    |    AFTER
-------------------------------------------------------------------------------------------------------
Validation errors                        No     |   No                 n/a       |    n/a
mountChecker.Exists()                    No     |   Yes                Yes       |    Yes
os.Remove() -> os.ErrNotExist            No     |   Yes                Yes       |    Yes  (wrapped)
os.Remove() -> other errors              No     |   Yes                Yes       |    Yes  (wrapped)
Mount not exist, remove succeeds         No     |   Yes                n/a       |    n/a
mounter.Unmount()                        No     |   Yes                No        |    Yes  (wrapped)
persistState()                           No     |   Yes                No        |    No
--------------------------------------------------------------------------------------------------------

Backward Compatibility

Yes, backward compatible.

Copy link
Member

@mariash mariash left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation bot moved this from Inbox to Pending Merge | Prioritized in Application Runtime Platform Working Group Jan 6, 2026
@mariash mariash merged commit 8df029f into cloudfoundry:main Jan 6, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from Pending Merge | Prioritized to Done in Application Runtime Platform Working Group Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants