From 1eb39450fbecd9b2b56b74ee5ab77db5a10712ee Mon Sep 17 00:00:00 2001 From: RandithaK Date: Sat, 8 Nov 2025 01:58:32 +0530 Subject: [PATCH] fix: Update yq command to only target Deployment resource - Use select(.kind == "Deployment") to ensure yq only modifies the Deployment - Prevents accidental modification of Service resource in multi-document YAML - Fixes CI/CD failure caused by invalid Service fields --- .github/workflows/deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index cc2d700..e7bdd81 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -48,7 +48,7 @@ jobs: - name: Update image tag in YAML run: | - yq -i '.spec.template.spec.containers[0].image = "ghcr.io/techtorque-2025/api_gateway:${{ steps.get_sha.outputs.sha }}"' config-repo/k8s/services/gateway-deployment.yaml + yq -i '(select(.kind == "Deployment") | .spec.template.spec.containers[0].image) = "ghcr.io/techtorque-2025/api_gateway:${{ steps.get_sha.outputs.sha }}"' config-repo/k8s/services/gateway-deployment.yaml # --- NEW DEBUGGING STEP --- - name: Display file contents before apply