[WIP] Move dataset.spec.mounts length validation logic from the CRD definition down into the controller #4356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With Fluid's expansion for flexible usage of datasets, it is now permitted for the length of the mounts array in a dataset to be zero in some Runtimes. For example, the recent version supports dynamic mounting capabilities and the dataset bound with Vinyard runtime only allowed zero length mountPoints.
However, the existing definition of the Dataset Custom Resource Definition (CRD) enforces a minimum length of 1 for the Dataset.spec.mounts field. This minimum length constraint in the CRD limits the flexibility of the dataset. As datasets are intended to be an abstract collection of data and designed as mutable APIs, the validation logic for the mounts field should not be uniformly restricted by the CRD. Instead, it should be up to the runtime level to determine whether and how to impose such restrictions.
Therefore, in this pull request, I propose removing the minNum constraint on dataset.spec.mounts in the CRD and delegating the validation of the length of dataset mounts to the implementation of the controller.