yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.07k stars 116 forks source link

Failing on ConfigMap empty key values? #240

Open esn89 opened 8 months ago

esn89 commented 8 months ago

I have successfully helm linted and helm template some purposefully wrong ConfigMaps, then piping them to kubeconform.

As an example I have:

apiVersion: v1
data:
  ENDPOINT_NAME: 
  ENDPOINT_TYPE: "https"
kind: ConfigMap
metadata:
  name: weee
  namespace: woo

When piped, I get:

cat test.yaml | kubeconform -summary -verbose -strict
stdin - ConfigMap weee is valid
Summary: 1 resource found parsing stdin - Valid: 1, Invalid: 0, Errors: 0, Skipped: 0

How can I make it fail on empty values?

yannh commented 8 months ago

Hi @esn89 , Kubeconform only does some pretty basic validation of Kubernetes manifests, using the Kubernetes OpenAPI schemas. In this case I suspect your file is "valid" according to the schema for a Configmap - if it is, Kubeconform is likely not the right tool to validate that you have no empty values, unfortunately :bow: