Skip to content

Commit

Permalink
find + exec is very slow
Browse files Browse the repository at this point in the history
it is way faster to run kubeval once with the files as arguments
or using `-d`
  • Loading branch information
carlossg committed May 15, 2020
1 parent dbeb2a2 commit ffcd01d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions docs/contrib.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Add the following to your Kubernetes configs repository in `.git/hooks/pre-commi
This will validate all the `yaml` files in the top directory of the repository.

```shell
#!/bin/sh
#!/bin/sh -e

echo "Running kubeval validations..."

Expand All @@ -20,11 +20,7 @@ if ! [ -x "$(command -v kubeval)" ]; then
fi

# Inspect code using kubeval
find . -maxdepth 1 -name '*.yaml' -exec kubeval {} \;

status=$?

if [ "$status" = 0 ] ; then
if kubeval --strict -d . ; then
echo "Static analysis found no problems."
exit 0
else
Expand Down

0 comments on commit ffcd01d

Please sign in to comment.