From 88e87b5f71478daff8150d32beed2af939005c51 Mon Sep 17 00:00:00 2001 From: Ryan Ahearn Date: Fri, 11 Jul 2025 12:15:58 -0400 Subject: [PATCH 1/2] Allow replacing sandbox worker space to clear PRESERVEd workers --- sandbox-deploy/terraform.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sandbox-deploy/terraform.sh b/sandbox-deploy/terraform.sh index cf49632..2093f94 100755 --- a/sandbox-deploy/terraform.sh +++ b/sandbox-deploy/terraform.sh @@ -7,11 +7,12 @@ $0: Run terraform commands against a given environment Usage: $0 -h - $0 [-f] [-c ] [-- ] + $0 [-f] [-c ] [-r] [-- ] Options: -h: show help and exit -f: Force, pass -auto-approve to all invocations of terraform +-r: Replace worker space, useful to reset after using PRESERVE_WORKER -c TERRAFORM-CMD: command to run. Defaults to $cmd []: arguments to pass as-is to terraform " @@ -19,9 +20,10 @@ Options: force="" args_to_shift=0 +declare -a optional_args set -e -while getopts ":hfc:" opt; do +while getopts ":hfrc:" opt; do case "$opt" in f) force="-auto-approve" @@ -31,6 +33,11 @@ while getopts ":hfc:" opt; do cmd=${OPTARG} args_to_shift=$((args_to_shift + 2)) ;; + r) + optional_args+=(-replace=module.sandbox-runner.module.worker_space.cloudfoundry_space.space) + optional_args+=(-replace="module.sandbox-runner.module.worker_space.cloudfoundry_security_group_space_bindings.security_group_bindings[\"trusted_local_networks_egress\"]") + args_to_shift=$((args_to_shift + 1)) + ;; h) echo "$usage" exit 0 @@ -48,6 +55,6 @@ cf org $dev_org &> /dev/null || cf login -a api.fr-stage.cloud.gov --sso -o $dev terraform init echo "==============================================================================================================" -echo "= Calling $cmd $force $@ on the sandbox infrastructure" +echo "= Calling $cmd $force " "${optional_args[@]}" " " "$@" " on the sandbox infrastructure" echo "==============================================================================================================" -terraform "$cmd" $force -compact-warnings "$@" +terraform "$cmd" $force -compact-warnings "${optional_args[@]}" "$@" From 34b0bb2d2e1d7d999b04bb8860602baabdd41235 Mon Sep 17 00:00:00 2001 From: Ryan Ahearn Date: Fri, 11 Jul 2025 12:16:13 -0400 Subject: [PATCH 2/2] Run git lfs install in worker setup --- .../worker-setup/bundle/glrw-setup.d/git-lfs-setup.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 runner-manager/cf-driver/worker-setup/bundle/glrw-setup.d/git-lfs-setup.sh diff --git a/runner-manager/cf-driver/worker-setup/bundle/glrw-setup.d/git-lfs-setup.sh b/runner-manager/cf-driver/worker-setup/bundle/glrw-setup.d/git-lfs-setup.sh new file mode 100755 index 0000000..10c8180 --- /dev/null +++ b/runner-manager/cf-driver/worker-setup/bundle/glrw-setup.d/git-lfs-setup.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +git lfs install