Skip to content

Establish and validate driver name limitations #168

@BlaineEXE

Description

@BlaineEXE

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    api/v1alpha2Issue reported against or feature request for v1alpha2 APIgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions