From 54afa11ce5073855b1a97d63d932bda4271cb79b Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Fri, 15 Jul 2022 03:29:10 +0200
Subject: [PATCH] ci(Makefile): Update K8s version and exclude helm charts from
 validation

---
 scripts/validate.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/validate.sh b/scripts/validate.sh
index b20a22ef7..009cfa89a 100755
--- a/scripts/validate.sh
+++ b/scripts/validate.sh
@@ -30,20 +30,20 @@
 
 set -o errexit
 
-KUBERNETES_VERSION=1.21.8
+KUBERNETES_VERSION=1.22.12
 
 echo "INFO - Downloading Flux OpenAPI schemas"
 mkdir -p /tmp/flux-crd-schemas/master-standalone-strict
 curl -sL https://github.com/fluxcd/flux2/releases/latest/download/crd-schemas.tar.gz | tar zxf - -C /tmp/flux-crd-schemas/master-standalone-strict
 
-find . -type f -name '*.yaml' -print0 | while IFS= read -r -d $'\0' file;
+find . -type f -name '*.yaml' ! -path "./charts/*" -print0  | while IFS= read -r -d $'\0' file;
   do
     echo "INFO - Validating $file"
     yq e 'true' "$file" > /dev/null
 done
 
 echo "INFO - Validating clusters"
-find ./clusters -maxdepth 2 -type f -name '*.yaml' -print0 | while IFS= read -r -d $'\0' file;
+find ./clusters -maxdepth 2 -type f -name '*.yaml' ! -path "./charts/*" -print0 | while IFS= read -r -d $'\0' file;
   do
     kubeval ${file} --strict --ignore-missing-schemas --kubernetes-version ${KUBERNETES_VERSION} --additional-schema-locations=file:///tmp/flux-crd-schemas
     if [[ ${PIPESTATUS[0]} != 0 ]]; then
@@ -56,7 +56,7 @@ kustomize_flags="--load-restrictor=LoadRestrictionsNone --reorder=legacy"
 kustomize_config="kustomization.yaml"
 
 echo "INFO - Validating kustomize overlays"
-find . -type f -name $kustomize_config -print0 | while IFS= read -r -d $'\0' file;
+find . -type f -name $kustomize_config ! -path "./charts/*" -print0  | while IFS= read -r -d $'\0' file;
   do
     echo "INFO - Validating kustomization ${file/%$kustomize_config}"
     kustomize build "${file/%$kustomize_config}" $kustomize_flags | \
-- 
GitLab