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

Invalid namespace file passes kubeval #321

Open
jobinjosem1 opened this issue Oct 15, 2021 · 2 comments
Open

Invalid namespace file passes kubeval #321

jobinjosem1 opened this issue Oct 15, 2021 · 2 comments

Comments

@jobinjosem1
Copy link

apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: Test2
spec: {}
status: {}

Trying to validate a namespace YAML file that has an invalid name.
If I apply it with dry-run=server flag it throws error "The Namespace "Test2" is invalid: metadata.name: Invalid value: "Test2": a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is 'a-z0-9?')" but kubeval doesn't detect this as an error.

@ivan-penchev
Copy link

just use the --strict flag.

@Moulick
Copy link

Moulick commented Nov 13, 2021

kubeval --version
Version: 0.16.1
Commit: f5dba6b486fa18b9179b91e15eb6f2b0f7a5a69e
Date: 2021-03-30T15:16:16Z

@ivan-penchev also passes with --strict unfortunately
the below namespace is also considered valid, while it's not

apiVersion: v1
kind: Namespace
metadata:
  name: .dummy

PASS - ns.yaml contains a valid Namespace (.dummy)

CC: @hasheddan might be you are also interested in this as well

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