Skip to content
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

Remove DNS length validation for non-DNS related resource names #1187

Open
damyan opened this issue Dec 13, 2024 · 1 comment
Open

Remove DNS length validation for non-DNS related resource names #1187

damyan opened this issue Dec 13, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@damyan
Copy link
Member

damyan commented Dec 13, 2024

Currently we enforce 64 character length for resource names by using a kubernetes API DNS validation mechanism. We shoould loosen up this requirement by allowing longer resource names.

An example with ConfigMap in kubernetes, which allows 254 character length for resource names.

@damyan damyan added the enhancement New feature or request label Dec 13, 2024
@damyan damyan added this to Core Dec 13, 2024
@afritzler afritzler moved this to 🥶 IceBox in Core Jan 17, 2025
@ushabelgur
Copy link
Contributor

We are using ValidateObjectMetaAccessor from apiMachinery package to validate names. This functions validates object's metadata on creation. It expects that name generation has already been performed. (

allErrs = append(allErrs, apivalidation.ValidateObjectMetaAccessor(networkInterface, true, apivalidation.NameIsDNSLabel, field.NewPath("metadata"))...)
)

This is the validation used for ConfigMap in kubernetes https://github.com/kubernetes/kubernetes/blob/c26c59a0b85a92194a5ce0ce72f67eac2b84e1fd/pkg/apis/core/validation/validation.go#L6899C52-L6899C70
https://github.com/kubernetes/kubernetes/blob/c26c59a0b85a92194a5ce0ce72f67eac2b84e1fd/staging/src/k8s.io/apimachinery/pkg/api/validation/generic.go#L37
it follows DNSSubDomain format : a lowercase RFC 1123 subdomain consist of lower case alphanumeric characters, '-' or '.', and start and end with an alphanumeric character
where as current validation follows DNSLable format: a lowercase RFC 1123 label consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (No . allowed like in subdomain)

@afritzler can we use the same method used by configMap in our validation ? question is do we want to allow . also in the names then ?

@ushabelgur ushabelgur self-assigned this Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🥶 IceBox
Development

No branches or pull requests

2 participants