From cce4a74669a3f6905aeb2c48352a4b0b895ddd57 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Wed, 25 Sep 2024 16:00:22 -0700 Subject: [PATCH] Revert "refactor: use `-chdir` in terraform_validate wrapper" (#2624) --- infra/build/Makefile | 2 +- .../build/scripts/task_wrapper_scripts/terraform_validate | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/infra/build/Makefile b/infra/build/Makefile index a5e0919bb5f..60ff2a5c643 100644 --- a/infra/build/Makefile +++ b/infra/build/Makefile @@ -56,7 +56,7 @@ OPA_VERSION := 0.52.0 # Updated by Update Tooling Workflow GCRANE_VERSION := 0.20.2 -DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.22.13 +DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.22.12 DOCKER_TAG_MAJOR_VERSION_DEVELOPER_TOOLS := $(firstword $(subst ., , $(DOCKER_TAG_VERSION_DEVELOPER_TOOLS))) DOCKER_TAG_MINOR_VERSION_DEVELOPER_TOOLS := $(shell echo "${DOCKER_TAG_VERSION_DEVELOPER_TOOLS}" | awk -F. '{print $$1"."$$2}') diff --git a/infra/build/developer-tools/build/scripts/task_wrapper_scripts/terraform_validate b/infra/build/developer-tools/build/scripts/task_wrapper_scripts/terraform_validate index bd57e5a6adc..172ba205279 100755 --- a/infra/build/developer-tools/build/scripts/task_wrapper_scripts/terraform_validate +++ b/infra/build/developer-tools/build/scripts/task_wrapper_scripts/terraform_validate @@ -19,5 +19,8 @@ # files to validate. This directory is assumed to be a root module. set -eu -flock -x /workspace/.terraform.lock -c "terraform init -compact-warnings -chdir=$1 -backend=false >/dev/null" -flock -s /workspace/.terraform.lock -c "terraform -chdir=$1 validate" +curdir=$(pwd) +cd "${1}" +flock -x /workspace/.terraform.lock -c "terraform init -backend=false >/dev/null" +flock -s /workspace/.terraform.lock -c "terraform validate" +cd "$curdir"