Skip to content

Commit ffcd01d

Browse files
authored
find + exec is very slow
it is way faster to run kubeval once with the files as arguments or using `-d`
1 parent dbeb2a2 commit ffcd01d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

docs/contrib.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Add the following to your Kubernetes configs repository in `.git/hooks/pre-commi
1010
This will validate all the `yaml` files in the top directory of the repository.
1111

1212
```shell
13-
#!/bin/sh
13+
#!/bin/sh -e
1414

1515
echo "Running kubeval validations..."
1616

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

2222
# Inspect code using kubeval
23-
find . -maxdepth 1 -name '*.yaml' -exec kubeval {} \;
24-
25-
status=$?
26-
27-
if [ "$status" = 0 ] ; then
23+
if kubeval --strict -d . ; then
2824
echo "Static analysis found no problems."
2925
exit 0
3026
else

0 commit comments

Comments
 (0)