stelligent / config-lint

Command line tool to validate configuration files
https://stelligent.github.io/config-lint/#/
MIT License
195 stars 39 forks source link

Parse YAML files containing multiple documents? #223

Open larsks opened 3 years ago

larsks commented 3 years ago

I'd like to use config-lint to check Kubernetes manifests output by kustomize build. That produces a YAML stream containing multiple documents, like:

apiVersion: v1
kind: Namespace
metadata:
  name: project-operator
spec: {}
---
apiVersion: v1
kind: Namespace
metadata:
  name: external-secrets
spec: {}
---
apiVersion: v1
kind: Namespace
metadata:
  name: gpu-operator-resources
spec: {}

If I try to process this with config-lint, I get:

$ config-lint -rules rules out.yaml
{
  "FilesScanned": [
    "out.yaml"
  ],
  "Violations": [],
  "ResourcesScanned": []
}

That is, despite config-lint says that it has checked no resources, even though the file contains many resources.