-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
osd: limit storageClassDeviceSets to 63 chars #14134
Conversation
testing result ka cluster-on-pvc.yaml
The CephCluster "rook-ceph" is invalid:
* spec.storage.storageClassDeviceSets[0].name: Too long: may not be longer than 63
* <nil>: Invalid value: "null": some validation rules were not checked because the object was invalid; correct the existing errors to complete validation |
pkg/apis/ceph.rook.io/v1/types.go
Outdated
@@ -2937,6 +2937,7 @@ type PriorityClassNamesSpec map[KeyType]string | |||
// +nullable | |||
type StorageClassDeviceSet struct { | |||
// Name is a unique identifier for the set | |||
// +kubebuilder:validation:MaxLength=63 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 63 the length that actually causes the issue? Or is it actually shorter because the name of the device set is concatenated with something else to create the resource name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that true it adds the *-local-volume-storageclass-0-data-*
which should have a check on total length too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That quite a lot of characters added. Are the asterisks also added? I'm a bit confused. I don't think asterisks are allowed characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually asterisks are placeholder here for the real names
874bd4e
to
8276378
Compare
return fmt.Sprintf("%s-%s-%d", deviceSetName, cleanName, setIndex) | ||
pvcID := fmt.Sprintf("%s-%s-%d", deviceSetName, cleanName, setIndex) | ||
if len(pvcID) > 62 { | ||
return "", fmt.Errorf("length of generate pvc should be less the 63 as the 'volumeMount[*].Name' has limit of 63 char. Current length' %d", len(pvcID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this message so it is clear what they need to change?
return "", fmt.Errorf("length of generate pvc should be less the 63 as the 'volumeMount[*].Name' has limit of 63 char. Current length' %d", len(pvcID)) | |
return "", fmt.Errorf("the OSD PVC name requested is %q (length %d) is too long and must be less than 63 characters, shorten either the storageClassDeviceSet name or the storage class name", pvcID, len(pvcID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
there are some cases where storageClassDeviceSets length are more 63 chars and osd provisioned failed due to this. with error ``` failed to run osd provisioning job for PVC "ocs-deviceset-*-local-volume-storageclass-0-data-*": Job.batch "rook-ceph-osd-prepare-*" is invalid: [spec.template.spec.volumes[10].name: Invalid value: "ocs-deviceset-*-local-volume-storageclass-0-data-*": must be no more than 63 characters, spec.template.spec.containers[0].volumeMounts[9].name: Not found: "ocs-deviceset-*-local-volume-storageclass-0-data-*", ``` Using x-validator to limit the maxLength to the deviceClassSet.Name to 40 chars and adding code check that overall pvc name should be less than 63 chars. Signed-off-by: subhamkrai <[email protected]>
8276378
to
6f5cc9b
Compare
osd: limit storageClassDeviceSets to 63 chars (backport #14134)
Is a "deviceset" a Rook-internal thing? |
@anthonyeleven yess |
@anthonyeleven For an example of the |
there are some cases where storageClassDeviceSets length are more 63 chars and osd provisioned failed due to this. with error
Using x-validator to limit the maxLength to 63 chars.
Checklist: