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

can not valid field name error which is the main key for deployment #69

Closed
jdxyw opened this issue Mar 30, 2018 · 1 comment
Closed

Comments

@jdxyw
Copy link

jdxyw commented Mar 30, 2018

Hi, I make a fake yaml like below

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: lq
    load_balancer: AAA
    name: AAA
    namespace: algorithm
  name: AAA
  namespace: algorithm
**specASDUWIUE**:
  replicas: 1
  revisionHistoryLimit: 1
  selector:
    matchLabels:
      load_balancer: AAA

the highlight key specASDUWIUE should be spec. But this tool still pass the validation.

@garethr
Copy link
Collaborator

garethr commented Mar 30, 2018

Hi @jdxyw. If you try running kubeval with --strict I think you should see this manifest fail.

The problem here is:

  • spec isn't actually a required field for deployment
  • the Kubernetes API is actually quite happy to be send fields (like specASDUWIUE) that it doesn't know about
  • kubectl however fails when it sees fields like this

Let me know if that works for you, if not please re-open the issue and I'll take a closer look.

@garethr garethr closed this as completed Mar 30, 2018
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

2 participants