-
Notifications
You must be signed in to change notification settings - Fork 108
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
controller get capacity method added #483
base: master
Are you sure you want to change the base?
controller get capacity method added #483
Conversation
Signed-off-by: Basit Hasan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @basit9958 , thanks for your contribution.
I mentioned one relevant point; there are a few others worth calling out, but I'd like to get alignment first on what GetCapacity
should do in order to make sure we're on the same page.
driver/controller.go
Outdated
|
||
// Create a new response object | ||
resp := &csi.GetCapacityResponse{ | ||
AvailableCapacity: totalCapacity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU the spec for GetCapacity
, the availability capacity is not how much storage capacity is currently in use but how much capacity is available to the user.
I believe this is essentially the volume limit (which we still reference to some extent in the checkLimit
method that is otherwise unused and was missed for removal in #481) minus the currently used capacity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are correct, we can use limitdetails.limit and minus it with used capacity. Used capacity can be calculated by checking volumes whose droplet id are not nil and adding their size.
@timoreimann It should return the total amount of storage capacity that can be allocated for volumes, minus the capacity already in use by existing volumes. I'll update the code tomorrow |
Signed-off-by: Basit Hasan <[email protected]>
cc @fatih