From 70c69aa04df0390d0a0219343f3dca66cdb1f3bf Mon Sep 17 00:00:00 2001 From: Niall Thomson Date: Tue, 1 Oct 2024 17:23:49 -0600 Subject: [PATCH] chore: Improve mounting of files in shell container --- hack/shell.sh | 2 +- lab/bin/reset-environment | 12 ++++-------- lab/scripts/entrypoint.sh | 2 ++ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/hack/shell.sh b/hack/shell.sh index a7924b3d4..29e40e2ce 100644 --- a/hack/shell.sh +++ b/hack/shell.sh @@ -38,7 +38,7 @@ if [ ! -z "$DOCKER_DNS_OVERRIDE" ]; then fi $CONTAINER_CLI run --rm $interactive_args $dns_args \ - -v $SCRIPT_DIR/../manifests:/manifests \ + -v $SCRIPT_DIR/../manifests:/eks-workshop/manifests \ -v $SCRIPT_DIR/../cluster:/cluster \ -e 'EKS_CLUSTER_NAME' -e 'AWS_REGION' \ $aws_credential_args $container_image $shell_command \ No newline at end of file diff --git a/lab/bin/reset-environment b/lab/bin/reset-environment index 06df2c229..34762661e 100644 --- a/lab/bin/reset-environment +++ b/lab/bin/reset-environment @@ -52,13 +52,11 @@ catch() { mkdir -p /eks-workshop -rm -f /home/ec2-user/environment/eks-workshop - -rm -rf $manifests_path - REPOSITORY_REF=${REPOSITORY_REF:-""} if [ ! -z "${REPOSITORY_REF}" ]; then + rm -f /home/ec2-user/environment/eks-workshop + rm -rf $manifests_path rm -rf $repository_path logmessage "Refreshing copy of workshop repository from GitHub..." @@ -68,11 +66,9 @@ if [ ! -z "${REPOSITORY_REF}" ]; then logmessage "" cp -R $repository_path/manifests $manifests_path -elif [ -d "/manifests" ]; then - cp -R /manifests $manifests_path -fi -ln -s $manifests_path /home/ec2-user/environment/eks-workshop + ln -s $manifests_path /home/ec2-user/environment/eks-workshop +fi if [ ! -z "$module" ]; then ANALYTICS_ENDPOINT=${ANALYTICS_ENDPOINT:-""} diff --git a/lab/scripts/entrypoint.sh b/lab/scripts/entrypoint.sh index 6cfcf1e94..012f68c12 100644 --- a/lab/scripts/entrypoint.sh +++ b/lab/scripts/entrypoint.sh @@ -4,6 +4,8 @@ set -e bash /tmp/setup.sh +ln -s /eks-workshop/manifests /home/ec2-user/environment/eks-workshop + if [ ! -z "$EKS_CLUSTER_NAME" ]; then aws eks update-kubeconfig --name $EKS_CLUSTER_NAME fi