Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue that GetVolumePath return a nil instead of error when can't get partition uuid #1078

Closed
wants to merge 2 commits into from

Conversation

libzhang
Copy link
Collaborator

@libzhang libzhang commented Feb 7, 2024

Purpose

Resolves #

This is to resolve that an issue that GetVolumePath always return a nil when met error in getting partition stage.
we should return error if any error met in getting partition stage.

In RPC NodeStageVolume request, below code should return an err if GetVolumePath failed, this will then cause NodeStageVolume failure.
then Kubelet should retry this rpc again and again. This give the chance that driveCR updated success.

partition, err := s.getProvisionerForVolume(&volumeCR.Spec).GetVolumePath(&volumeCR.Spec)

Changes:
this change fix an issue that a global err is defined, but we have another local err variable defined in a {} scope, so finally the global err always is nil.
Here we remove the retry for loop and always use the global err variable, as currently in search partition command, we already have a retry. so the retry here is not needed any more.

PR checklist

  • Add link to the issue
  • Choose Project
  • Choose PR label
  • New unit tests added
  • Modified code has meaningful comments
  • All TODOs are linked with the issues
  • All comments are resolved

Testing

Provide test details

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f45d675) 72.76% compared to head (6302fdb) 72.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1078      +/-   ##
==========================================
+ Coverage   72.76%   72.79%   +0.02%     
==========================================
  Files          63       63              
  Lines        8949     8946       -3     
==========================================
  Hits         6512     6512              
+ Misses       2147     2145       -2     
+ Partials      290      289       -1     
Flag Coverage Δ
unittests 72.79% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@libzhang libzhang closed this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants