remove cache dir from kubeconform workflow
This commit is contained in:
@@ -12,7 +12,7 @@ jobs:
|
|||||||
kubeconform:
|
kubeconform:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: gitea.akshun-lab.cc/aggarwalakshun/kube-tools:1.0.0
|
image: gitea.akshun-lab.cc/aggarwalakshun/kube-tools:1.1.0
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
@@ -47,13 +47,11 @@ jobs:
|
|||||||
)
|
)
|
||||||
|
|
||||||
EXIT_CODE=0
|
EXIT_CODE=0
|
||||||
export KUBECONFORM_CACHE_DIR="/tmp/kubeconform-cache"
|
|
||||||
mkdir -p "$KUBECONFORM_CACHE_DIR"
|
|
||||||
|
|
||||||
for file in ${ALL_CHANGED_FILES}; do
|
for file in ${ALL_CHANGED_FILES}; do
|
||||||
[ -z "$file" ] && continue
|
[ -z "$file" ] && continue
|
||||||
echo "=== Validating: $file ==="
|
echo "=== Validating: $file ==="
|
||||||
# Split YAML into individual docs, output as JSON, and process each
|
|
||||||
yq e -o=json '. as $item ireduce ([]; . + [$item])' "$file" | \
|
yq e -o=json '. as $item ireduce ([]; . + [$item])' "$file" | \
|
||||||
jq -c '.[] | select(.kind != null)' | \
|
jq -c '.[] | select(.kind != null)' | \
|
||||||
while read -r manifest; do
|
while read -r manifest; do
|
||||||
@@ -65,7 +63,6 @@ jobs:
|
|||||||
|
|
||||||
if ! echo "$manifest" | kubeconform \
|
if ! echo "$manifest" | kubeconform \
|
||||||
-schema-location "$SCHEMA_URL" \
|
-schema-location "$SCHEMA_URL" \
|
||||||
-cache "$KUBECONFORM_CACHE_DIR" \
|
|
||||||
-output json \
|
-output json \
|
||||||
-; then
|
-; then
|
||||||
EXIT_CODE=1
|
EXIT_CODE=1
|
||||||
@@ -74,7 +71,6 @@ jobs:
|
|||||||
echo "Validating with default schemas"
|
echo "Validating with default schemas"
|
||||||
if ! echo "$manifest" | kubeconform \
|
if ! echo "$manifest" | kubeconform \
|
||||||
-schema-location default \
|
-schema-location default \
|
||||||
-cache "$KUBECONFORM_CACHE_DIR" \
|
|
||||||
-output json \
|
-output json \
|
||||||
-; then
|
-; then
|
||||||
EXIT_CODE=1
|
EXIT_CODE=1
|
||||||
|
|||||||
Reference in New Issue
Block a user