-
Notifications
You must be signed in to change notification settings - Fork 118
Description
Describe the problem/challenge you have
I've submitted a PR (#656) that revert the (ref)quota of a volume if its (ref)reservation couldn't been expanded in order to fix the issue (#649) that render a volume having different values for its (ref)quota and (ref)reservation. While reverting fixes the issue, it is also the least desirable option, however NodeExpandVolume has to handle this case anyway.
Describe the solution you'd like
A way to prevent this to happen (most of the time) would be to implement a check in ControllerExpandVolume, we should check that the additional capacity doesn't exceed the currently available capacity, and fail with a ResourceExhausted error code when it does. And that way, the ZfsVolume wouldn't even be updated with the new (invalid) size.
Anything else you would like to add:
Maybe we can read the currently available capacity from the corresponding CSIStorageCapacity object, or maybe even better: we could reuse the code from the controller.GetCapacity function.