-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Enhancement
Why is this needed?:
COSI follows the CSI project pretty closely, including the driver name requirements. In CSI's proto definitions, they state a limitation of 63 chars for a driver name. However, I haven't been able to find the code in CSI that actually limits the driver name to that char limit.
In writing COSI's CEL validation rules, it is a best practice to establish // +kubebuilder:validation:MaxLength parameters for strings to help keep CEL rule complexity low. We can't do that unless we strongly limit the actual length of the string.
Describe the solution you'd like in detail:
If we want to stick to 63 chars, let's change the sidecar code to fail if any driver name is longer.
We could also raise the limit to 253 chars, to be the same as k8s resource name lenth limits. In that case, we should also update the proto spec text.
Describe alternatives you've considered:
We can continue to not validate the length of this param, but it would be best practice to do so.
It would be best to establish a length limit early in the project lifespan. Length limits can be extended in the future without API breakage, but reducing length limits is a breaking change that we must avoid unless it's not possible.
Give this, I lean toward establishing a name length limit of 63 chars now. this could be extended in the future if requested.
Additional context: