From 6879bae7717eed75f34dc849fa15613ca1110ed0 Mon Sep 17 00:00:00 2001 From: Akshun Aggarwal Date: Sun, 28 Dec 2025 00:57:34 +0000 Subject: [PATCH] Delete .gitea/workflows/kubeconform.yml --- .gitea/workflows/kubeconform.yml | 84 -------------------------------- 1 file changed, 84 deletions(-) delete mode 100644 .gitea/workflows/kubeconform.yml diff --git a/.gitea/workflows/kubeconform.yml b/.gitea/workflows/kubeconform.yml deleted file mode 100644 index f6d0823..0000000 --- a/.gitea/workflows/kubeconform.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Validate Kubernetes Manifests - -on: - push: - paths: - - '**.yml' - - '**.yaml' - - '!.gitea/workflows/**' - - '!clusters/default/system-upgrade/crd.yml' - -jobs: - kubeconform: - runs-on: ubuntu-latest - container: - image: gitea.akshun-lab.cc/aggarwalakshun/kube-tools:1.1.0 - steps: - - name: Checkout code - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v47 - with: - files: | - **.yml - !.gitea/workflows/** - !clusters/default/system-upgrade/crd.yml - - - name: Validate Manifests - if: steps.changed-files.outputs.any_changed == 'true' - env: - ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} - shell: bash - run: | - set -o pipefail - - declare -A SCHEMA_MAP=( - ["HelmRelease"]="helm.toolkit.fluxcd.io/helmrelease_v2.json" - ["HelmRepository"]="source.toolkit.fluxcd.io/helmrepository_v1.json" - ["L2Advertisement"]="metallb.io/l2advertisement_v1beta1.json" - ["IPAddressPool"]="metallb.io/ipaddresspool_v1beta1.json" - ["SealedSecret"]="bitnami.com/sealedsecret_v1alpha1.json" - ["ClusterPolicy"]="nvidia.com/clusterpolicy_v1.json" - ["Plan"]="upgrade.cattle.io/plan_v1.json" - ) - - EXIT_CODE=0 - - for file in ${ALL_CHANGED_FILES}; do - [ -z "$file" ] && continue - echo "=== Validating: $file ===" - - yq e -o=json '. as $item ireduce ([]; . + [$item])' "$file" | \ - jq -c '.[] | select(.kind != null)' | \ - while read -r manifest; do - KIND=$(echo "$manifest" | jq -r '.kind // ""') - - if [[ -n "$KIND" && -n "${SCHEMA_MAP[$KIND]}" ]]; then - echo "Found $KIND - using custom schema" - SCHEMA_URL="https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/${SCHEMA_MAP[$KIND]}" - - if ! echo "$manifest" | kubeconform \ - -schema-location "$SCHEMA_URL" \ - -output json \ - -; then - EXIT_CODE=1 - fi - else - echo "Validating with default schemas" - if ! echo "$manifest" | kubeconform \ - -schema-location default \ - -output json \ - -; then - EXIT_CODE=1 - fi - fi - done - - echo "" - done - - exit $EXIT_CODE