From ffcd01d528c06dc3bba227c480d510522f5e5192 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Fri, 15 May 2020 17:31:54 +0200 Subject: [PATCH] find + exec is very slow it is way faster to run kubeval once with the files as arguments or using `-d` --- docs/contrib.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/contrib.md b/docs/contrib.md index d94dd38..16ab255 100644 --- a/docs/contrib.md +++ b/docs/contrib.md @@ -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..." @@ -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