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

Deployment port name length not validated #178

Closed
stevehipwell opened this issue Mar 3, 2023 · 3 comments
Closed

Deployment port name length not validated #178

stevehipwell opened this issue Mar 3, 2023 · 3 comments

Comments

@stevehipwell
Copy link

When I run kubeconform on a deployment with the port name http-remote-write I don't get an error but when I try to deploy I get the following error.

Deployment.apps "thanos-receive-router" is invalid: spec.template.spec.containers[0].ports[2].name: Invalid value: "http-remote-write": must be no more than 15 characters

@eyarz
Copy link
Contributor

eyarz commented Mar 5, 2023

@stevehipwell this is happening because the port name validation is not part of the object schema.
therefore, this is only happening on the server side. you can read more about it here.

if you still want to make sure this check is also happening locally, you can do one of the following:

  1. open a PR the K8s project to update the schema to include this check
  2. use a 3rd tool for this validation (e.g. datree, polaris, kyverno, etc.). disclaimer: I'm one of the maintainers of datree and it should play really nicely with your use case because it will also run kubeconform.

@stevehipwell
Copy link
Author

Thanks for confirming this @eyarz. It might be worth listing the known validations not covered by the OpenAPI spec on the readme to make it easier to understand what needs additional consideration.

@eyarz
Copy link
Contributor

eyarz commented Mar 5, 2023

I agree, but we don't have the complete list of server-side validations which are not part of the schema.
It's an open-source project, so feel free to open a PR and add your issue to the readme :)

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

No branches or pull requests

3 participants