From bde4b1e255d55773cefa4dc86522ddf3fb49e15b Mon Sep 17 00:00:00 2001 From: Adrien Thebo Date: Wed, 22 Jun 2022 02:07:53 -0700 Subject: [PATCH] [install/infra] Add namespace/context to eks Terraform workspaces (#10809) At present we generate random 5 character workspace names for our terraform code. While suitable for machine use, these terse names don't provide execution context, making it difficult to locate relevant workspaces and prune old namespaces. ``` $ terraform workspace list|wc -l 298 ``` This commit addresses the issue by adding a prefix of the execution context (EKS) and the current unix epoch to auto-generated terraform workspace to assist identification of recent CI runs and remove stale workspaces. This commit doesn't address this issue in other environments (gke, k3s). We can address that in a followup commit. --- .werft/eks-installer-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.werft/eks-installer-tests.yaml b/.werft/eks-installer-tests.yaml index 96c376ebf465d2..eacd201f0c714c 100644 --- a/.werft/eks-installer-tests.yaml +++ b/.werft/eks-installer-tests.yaml @@ -74,7 +74,7 @@ pod: sudo chown -R gitpod:gitpod /workspace sudo apt update && apt install gettext-base - export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo) + export TF_VAR_TEST_ID="eks-$(date +%s)-$(echo $RANDOM | md5sum | head -c 5; echo)" (cd .werft && yarn install && mv node_modules ..) | werft log slice prep printf '{{ toJson . }}' > context.json