cleanup gcsfuse errofile before next NPV attempt#1371
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Sneha-at The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Code Review
This pull request introduces logic to clear stale error files in the NodePublishVolume function, preventing subsequent retries from being blocked by previous failures. It also includes a new unit test, TestNodePublishVolumeErrorFileCleanup, to verify that the error file is correctly deleted and that subsequent attempts succeed. The reviewer suggested using the existing util.CheckAndDeleteStaleFile utility instead of manual file removal to improve code reuse and ensure consistent path handling.
|
Is it possible to add an e2e test to make sure error file is cleared after it failed then succeeded after? |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Sidecar container adds any errors it encounters to an error file. This file is cleaned up only before a new mount operation is attempted. Any errors between NPV retries are propagated to the next attempt causing Node Publish Volume to log failures even if it succeeds. This PR cleans up the error file once it is read in node.go thus ensuring the error file only contains results related to the latest NPV call.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: