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

Relax name length restriction for Secrets/ConfigMaps. #1494

Closed
wants to merge 1 commit into from

Conversation

KenMacD
Copy link
Contributor

@KenMacD KenMacD commented Jun 9, 2023

The Kubernetes documentation states that the name of these resources much be a DNS subdomain name, which it defines as being up to 253 characters.

Following the referenced RFC it does appear that the name should be further restricted to require the 253 characters be made up of multiple of multiple 63-character labels separated by dots. The Kubernetes validation code does not apply this label restriction though, and will accept names longer than 63 characters.

This commit adjusts the length limits to match.

@rhatdan
Copy link
Member

rhatdan commented Jun 10, 2023

LGTM
Thanks @KenMacD
You must sign your commit.

git commit -a --amend -s
git push --force

The Kubernetes documentation states that the name of these resources
much be a DNS subdomain name, which it defines[1] as being up to 253
characters.

Following the referenced RFC it does appear that the name should be
further restricted to require the 253 characters be made up of multiple
of multiple 63-character labels separated by dots. The Kubernetes[2]
validation code does not apply this label restriction though, and will
accept names longer than 63 characters.

This commit adjusts the length limits to match.

[1]: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
[2]: https://github.com/kubernetes/apimachinery/blob/6b1428efc73348cc1c33935f3a39ab0f2f01d23d/pkg/util/validation/validation.go#L215

Signed-off-by: Kenny MacDermid <kenny@macdermid.ca>
@KenMacD
Copy link
Contributor Author

KenMacD commented Jun 13, 2023

Thanks @rhatdan! force-pushed.

Took me a second to figure out what you meant as my commit was already signed with my gpg key. I'm not sure how the signed-of line helps, but it's there now. (Slight git aside, I wouldn't include the -a in your example code as that might result in someone added other local changes rather than just changing the commit message.)

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2023

It looks like one of the configmaps tests is no longer failing

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2023

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2023

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: KenMacD, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member

rhatdan commented Jun 13, 2023

@umohnani8 @ygalblum PTAL

@ygalblum
Copy link
Contributor

The code looks OK, but you'll need to adjust the tests to the new restriction

@umohnani8
Copy link
Member

changes LGTM

rhatdan pushed a commit to rhatdan/common that referenced this pull request Jun 27, 2023
The Kubernetes documentation states that the name of these resources
much be a DNS subdomain name, which it defines[1] as being up to 253
characters.

Following the referenced RFC it does appear that the name should be
further restricted to require the 253 characters be made up of multiple
of multiple 63-character labels separated by dots. The Kubernetes[2]
validation code does not apply this label restriction though, and will
accept names longer than 63 characters.

This commit adjusts the length limits to match.

[1]: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
[2]: https://github.com/kubernetes/apimachinery/blob/6b1428efc73348cc1c33935f3a39ab0f2f01d23d/pkg/util/validation/validation.go#L215

Completes: containers#1494

Signed-off-by: Kenny MacDermid <kenny@macdermid.ca>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@rhatdan
Copy link
Member

rhatdan commented Jun 27, 2023

Thanks @KenMacD I updated your patch to fix the tests.

@rhatdan rhatdan closed this Jun 27, 2023
rhatdan pushed a commit to rhatdan/common that referenced this pull request Jun 28, 2023
The Kubernetes documentation states that the name of these resources
much be a DNS subdomain name, which it defines[1] as being up to 253
characters.

Following the referenced RFC it does appear that the name should be
further restricted to require the 253 characters be made up of multiple
of multiple 63-character labels separated by dots. The Kubernetes[2]
validation code does not apply this label restriction though, and will
accept names longer than 63 characters.

This commit adjusts the length limits to match.

[1]: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
[2]: https://github.com/kubernetes/apimachinery/blob/6b1428efc73348cc1c33935f3a39ab0f2f01d23d/pkg/util/validation/validation.go#L215

Completes: containers#1494

Signed-off-by: Kenny MacDermid <kenny@macdermid.ca>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants