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

When -kubernetes-version=X.Y (and not X.Y.Z) is provided, kubeconform cannot find schema even for built-in resources #119

Open
PawelLipski opened this issue Jul 11, 2022 · 1 comment

Comments

@PawelLipski
Copy link

PawelLipski commented Jul 11, 2022

Version: v0.4.13

Smallest repro:

cat > foo.yaml <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
  name: foo
data: {}
EOF

$ kubeconform -kubernetes-version=1.20 foo.yaml
foo.yaml - ConfigMap foo failed validation: could not find schema for ConfigMap

$ kubeconform -kubernetes-version=1.20.0 foo.yaml && echo OK
OK

The error should be something more clear, like just specify kubernetes-version as X.Y.Z rather as X.Y.

@yannh
Copy link
Owner

yannh commented Jul 15, 2022

Hi @PawelLipski , indeed the kubernetes version need to be x.y.z and something present in this repo https://github.com/yannh/kubernetes-json-schema . We could do some increased validation of the value to fail earlier.

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 a pull request may close this issue.

2 participants