From 9907e7f1b69c9612ac39d38f3b5e810e98d09ac0 Mon Sep 17 00:00:00 2001 From: Will Yardley Date: Wed, 25 Sep 2024 15:04:50 -0700 Subject: [PATCH] refactor: use `-chdir` in terraform_validate wrapper (#2617) --- infra/build/Makefile | 2 +- .../build/scripts/task_wrapper_scripts/terraform_validate | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/infra/build/Makefile b/infra/build/Makefile index 60ff2a5c643..a5e0919bb5f 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.12 +DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.22.13 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 172ba205279..bd57e5a6adc 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,8 +19,5 @@ # files to validate. This directory is assumed to be a root module. set -eu -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" +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"