fix (localpv): CSIStorageClass shows zero if SC "poolname" includes dataset path #393
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Fábián Tamás László giganetom@gmail.com
Why is this PR required? What issue does it fix?:
It fixes #392 "GetCapacity reports zero when using non-root dataset"
What this PR does?:
Amends pkg/driver/controller.go to return the root dataset's capacity when using a child dataset as the pool name.
I'm aware that this is not the ideal solution, as the child dataset may offer less capacitry than the whole pool, but this is most definitely better than returning a straigh zero like it's now.
The situation could further be improved if the Node could return the capacity of a child dataset.
Does this PR require any upgrade changes?:
No, this is just a simple fix in the capacity calculation.
If the changes in this PR are manually verified, list down the scenarios covered::
I've manually verified that the storage capacity returns the pool's capacity when a child dataset is used, and also when the "poolname" is really just the pool's name.
Any additional information for your reviewer? :
This is just a small, standalone fix, not part of anything greater.