-
Notifications
You must be signed in to change notification settings - Fork 960
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
[FEATURES] 允许 mounts 为空. Add 'allowEmptyMounts' field to allow 'mounts' to be empty. #4322
base: master
Are you sure you want to change the base?
[FEATURES] 允许 mounts 为空. Add 'allowEmptyMounts' field to allow 'mounts' to be empty. #4322
Conversation
Signed-off-by: dingyubo <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @y805939188. Thanks for your PR. I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Quality Gate passedIssues Measures |
@y805939188
If you have better suggestions, please feel free to share them. I am currently working on this issue and plan to submit a PR this week, so we can review it together. I'm also very interested in your business scenario and would love to have a deeper discussion about the dynamic mounting capabilities. Therefore, I will sent you an email and hope to receive a response. |
我已经发送微信好友申请了,有劳通过下,谢谢 |
Ⅰ. Describe what this PR does
Dataset
CRD 增加一个allowEmptyMounts
字段,如果为true
的话,则Dataset
的spec.mounts
允许传空。我的场景中,需要使用一个自定义的
ThinRuntime
去实现一些自定义挂载的功能,比如动态挂载/卸载数据集。在卸载数据集场景中,用户有可能把
mounts
卸成空。但是当前的 CRD 中,虽然kubebuilder
注释中写了 "允许为空":但是目前不生效:
原因可能是注释中存在
+kubebuilder:validation:MinItems=1
。因此增加一个新的字段
allowEmptyMounts
,为true
时才允许mounts
为空。这样相比直接去掉MinItems
的好处是增量修改,不影响原来其他任何地方。不过该功能只能在 k8s 1.25 以上版本生效,不确定
fluid
是否对向下兼容这块儿有什么要求。如果有什么问题的话请指出。谢谢~I would like to propose adding a new field
allowEmptyMounts
for theDataset
CRD to allowspec.mounts
to be empty. In my scenario, I am usingThinRuntimeProfile
to achieve features like dynamically mounting datasets. However, there are situations where a user might unmount all datasets, leaving no mountPoint. Therefore, I hope that Dataset can support passing an empty list forDataset.spec.mounts
, so it can handle the empty mounts scenario specifically in the ThinRuntimeProfile image.Currently, while the mounts code allows it to be empty, this is invalid due to the
Minitems
. To solve this, I added anallowEmptyMounts == true
flag, which permitsmounts
to be empty without affecting the existing logic. If there are any concerns regarding this change, please let me know. Thanks~Ⅱ. Does this pull request fix one issue?
fixes #4317
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Apply it like:
Ⅴ. Special notes for reviews