yannh / kubeconform

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

Annotations and Labels without values are not detected #287

Open chonton opened 2 months ago

chonton commented 2 months ago

For the resource below, I expect kubeconfig to complain about annotation values being empty (or null)

apiVersion: v1
kind: ConfigMap
metadata:
  name: some-values
  labels:
    some.domain/some-key:
  annotations:
    some.domain/some-key:
data:
  application.yaml: |-
    endpoints:
      service: https://example.com

Unfortunately, the ObjectMeta schema does not encode all requirements (or the schema validation package cannot detect missing values). I suspect that kubeconform would need to separately validate these requirements:

Similar to #275, #286, and #240