Closed wondywang closed 1 year ago
@christopherhein PTAL, thanks.
Out of curiosity, what is the difference between these two values?
Out of curiosity, what is the difference between these two values?
// DNS1123SubdomainMaxLength is a subdomain's max length in DNS (RFC 1123)
const DNS1123SubdomainMaxLength int = 253
// DNS1123LabelMaxLength is a label's max length in DNS (RFC 1123)
const DNS1123LabelMaxLength int = 63
And the maximum length supported by namespace is 63 characters.
Is DNS1123SubdomainMaxLength changed? I clearly remember this should be 64, otherwise the code is wrong.
I'm not sure about this. But I found the latest definition, it is indeed the case. Because I recently discovered that there was too long namespace that was not synchronized, and then I found the reason here.
https://github.com/kubernetes/apimachinery/blob/master/pkg/util/validation/validation.go#L209
Did you change your kubernetes version locally?
Did you change your kubernetes version locally?
no. and I checked the historical version of k8s.io/apimachinery, it should always be that value.
cool. Thanks for fixing the long-term bug then.
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Fei-Guo, wondywang
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What type of PR is this? /kind bug
What this PR does / why we need it: As mentioned here, https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#namespaces-and-dns, all namespace names must be valid RFC 1123 DNS labels.