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

kubernetes: add endpoint_pod_names test #149

Merged
merged 6 commits into from
Oct 7, 2021

Conversation

chrisohaver
Copy link
Member

Adds a test for endpoint_pod_names.
Includes a test for a long pod name exceeding valid DNS label length.

Signed-off-by: Chris O'Haver cohaver@infoblox.com

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
@chrisohaver
Copy link
Member Author

chrisohaver commented Oct 6, 2021

The Deployment "deployment-2" is invalid: spec.template.spec.containers[0].name: Invalid value: "test-pod-name-longer-than-63-characters-making-it-an-invalid-dns-label": must be no more than 63 characters

OK... well I suppose its impossible to create a Pod with a name this size. So, this test is not needed... validation happens in the API.

edit: no - the manifest was wrong - I was setting the container name, not the Pod name itself. Curiously container name is validated as a dns label, even though it's not used in the DNS spec as a label.

@chrisohaver chrisohaver closed this Oct 6, 2021
@chrisohaver chrisohaver reopened this Oct 7, 2021
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
@chrisohaver
Copy link
Member Author

Damn. Looks like the process that spins up pods for a deployment will truncate the deployment name when constructing the pod name, such that it will be 63 characters, including the pod instance id.

So, to test we will need to create Pods directly.

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
@chrisohaver
Copy link
Member Author

yay

@chrisohaver chrisohaver marked this pull request as ready for review October 7, 2021 01:12
@chrisohaver chrisohaver merged commit 02fa03b into coredns:master Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant