Skip to content

Commit 2ca5689

Browse files
authored
[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.
1 parent 518ee22 commit 2ca5689

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.werft/eks-installer-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pod:
7474
sudo chown -R gitpod:gitpod /workspace
7575
sudo apt update && apt install gettext-base
7676
77-
export TF_VAR_TEST_ID=$(echo $RANDOM | md5sum | head -c 5; echo)
77+
export TF_VAR_TEST_ID="eks-$(date +%s)-$(echo $RANDOM | md5sum | head -c 5; echo)"
7878
7979
(cd .werft && yarn install && mv node_modules ..) | werft log slice prep
8080
printf '{{ toJson . }}' > context.json

0 commit comments

Comments
 (0)