You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a WorkloadSpread, the request will be intercepted by the Webhook and result in failure if the following conditions are met:
A subset of the WorkloadSpread contains a patch.
The WorkloadSpread's targetRef is an existing CloneSet.
This CloneSet has a volume template, and a container mounts that volume.
What you expected to happen:
Created successfully.
How to reproduce it (as minimally and precisely as possible):
Create a CloneSet named test-cs with a volume template
Create a WorkloadSpread whose targetRef is test-cs, and patches anything in a subset
An error related to volume will occur like:
Error from server: error when creating "workloadspread.yaml": admission webhook "vworkloadspread.kb.io" denied the request: [spec.subsets[0].patch.containers[0].volumeMounts[0].name: Not found: "vol-1"]
Anything else we need to know?:
This bug is caused by the validation of patches in the Webhook. During this validation, the Webhook reads the template of the existing target workload, applies the subset's patch to it as a real corev1.Pod object, and checks if the patched Pod is valid. In this bug, the patched Pod's volumes field does not contain the volumes related to the CloneSet's volume template, leading the Webhook to mistakenly believe that the patched Pod would mount a non-existent volume. As a result, it incorrectly deems the patch invalid, ultimately rejecting the creation of the WorkloadSpread.
Environment:
Kruise version: any
Kubernetes version (use kubectl version): any
Install details (e.g. helm install args):
Others:
The text was updated successfully, but these errors were encountered:
What happened:
When creating a WorkloadSpread, the request will be intercepted by the Webhook and result in failure if the following conditions are met:
targetRef
is an existing CloneSet.What you expected to happen:
Created successfully.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
This bug is caused by the validation of patches in the Webhook. During this validation, the Webhook reads the template of the existing target workload, applies the subset's patch to it as a real corev1.Pod object, and checks if the patched Pod is valid. In this bug, the patched Pod's
volumes
field does not contain the volumes related to the CloneSet's volume template, leading the Webhook to mistakenly believe that the patched Pod would mount a non-existent volume. As a result, it incorrectly deems the patch invalid, ultimately rejecting the creation of the WorkloadSpread.Environment:
kubectl version
): anyThe text was updated successfully, but these errors were encountered: