stelligent / config-lint

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

trying to check kubernetes yamls #150

Closed namloc2001 closed 4 years ago

namloc2001 commented 4 years ago

Hi, I'm running:

docker run -v $(pwd):/foobar stelligent/config-lint -rules example-files/rules/kubernetes.yml /foobar/configmap.yaml`

but I get this response:

Failed to load rules: open example-files/rules/kubernetes.yml: no such file or directory

When I run:

docker run -v $(pwd):/foobar stelligent/config-lint -rules

It gives:

flag needs an argument: -rules
Usage of /config-lint:
  -debug
        Debug logging
  -exclude value
        Filename pattern

(etc., etc..) So it appears to run ok, but can't find the rules. As I can't look inside the container (it exits straightaway) I'm struggling to debug. I just want to check kubernetes files, nothing else.

Thanks,

Matt

phelewski commented 4 years ago

@namloc2001 You will need to put the example Kubernetes rules into your local path and referencing to it accordingly, or you can have your own set of rules that you want to validate against.

For example:

docker run -v $(pwd):/foobar stelligent/config-lint -rules /foobar/path/to/my/rules/kubernetes.yml /foobar/path/to/my/configs/configmap.yaml

If you don't have your own set of custom rules that you want to run against your Kubernetes file then feel free to copy or download the example set that is listed here within the project.

At this time there isn't a default rule set for Kubernetes, but I will go ahead and create a new Issue for this as a new feature request.

phelewski commented 4 years ago

Issue #151 has been created to handle this new feature request.

namloc2001 commented 4 years ago

Thanks, I've created a pull request to apply some changes to the README.md as this had me stumped for a while.