cloud66-oss / copper

A configuration file validator for Kubernetes.
https://help.cloud66.com/copper/
Apache License 2.0
274 stars 16 forks source link

reading yml files from directory #8

Closed srjayep closed 5 years ago

srjayep commented 6 years ago

Is there a way to read bunch of yaml files from directory instead just a file to apply the rule. I currently have yml files stored in "files" directory and --file option isn't reading all the files.

copper check --rules myrule.cop --file files/*.yml

tried copper check --rules myrule.cop --dir files/*.yml , but no worky.

ERROR: "copper check" was called with arguments ["--dir", "files/elastic_scc.yml", "files/test-admin.yml"] Usage: "copper check"

khash commented 6 years ago

@srjayep currently Copper doesn't support multiple file checks (it does support multiple yamls in a single file separated by --- however).

To run Copper for multiple files in a folder you can try something like this:

for file in /dir/*
do
  copper [option] --file "$file" 
done