cloud-provider-openstack
cloud-provider-openstack copied to clipboard
[cinder-csi-plugin]: ResourceExhausted code for CreateVolume
What this PR does / why we need it:
If OpenStack quotas for volumes are exceeded, the driver currently returns the gRPC call with code Internal. This is not propagated to the PVC as an event and is not traceable very easily.
Cinder returns with a HTTP 413 response code if the quota for volumes is exceeded:
https://github.com/openstack/cinder/blob/c4f61c11ef9b590606a2a276bdf256622516181f/cinder/quota_utils.py#L130-L140
CSI spec defines that on a quota limit error, the driver should return a ResourceExhausted grpc error code:
https://github.com/container-storage-interface/spec/blob/master/spec.md#createvolume-errors
Release note:
Updated the error code to ResourceExhausted for CreateVolume calls if the volume quota is exceeded.