Skip to content

Commit

Permalink
fix: Fix error when running prepare-environment in certain directories
Browse files Browse the repository at this point in the history
  • Loading branch information
niallthomson committed Sep 13, 2024
1 parent f1d2c9c commit 7038f7c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lab/bin/reset-environment
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# Make sure we run from a consistent directory
cd ~

mkdir -p /eks-workshop/logs
log_file=/eks-workshop/logs/action-$(date +%s).log

Expand Down Expand Up @@ -121,6 +124,11 @@ rm -rf /eks-workshop/terraform
mkdir -p /eks-workshop/terraform
cp -R $manifests_path/.workshop/terraform/* /eks-workshop/terraform

# Use a separate directory for .terraform directory
# Allows us to wipe the TF configuration every time but retain providers installed
mkdir -p /eks-workshop/terraform-data
export TF_DATA_DIR="/eks-workshop/terraform-data"

export TF_VAR_eks_cluster_id="$EKS_CLUSTER_NAME"

RESOURCES_PRECREATED=${RESOURCES_PRECREATED:-"false"}
Expand Down Expand Up @@ -226,6 +234,7 @@ fi
# Recycle workload pods in case stateful pods got restarted
kubectl delete pod -l app.kubernetes.io/created-by=eks-workshop -l app.kubernetes.io/component=service -A

# Wait for the workload pods previously recycled
kubectl wait --for=condition=Ready --timeout=240s pods -l app.kubernetes.io/created-by=eks-workshop -A

# Finished
Expand Down

0 comments on commit 7038f7c

Please sign in to comment.