File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,12 +16,15 @@ bash $SCRIPT_DIR/update-iam-role.sh $environment
1616
1717sleep 5
1818
19+ pids=()
20+
1921cluster_exists=0
2022aws eks describe-cluster --name " ${EKS_CLUSTER_NAME} " & > /dev/null || cluster_exists=$?
2123
2224if [ $cluster_exists -ne 0 ] && [[ " $cluster " == " standard" || " $cluster " == " all" ]]; then
2325 echo " Creating cluster ${EKS_CLUSTER_NAME} "
24- bash $SCRIPT_DIR /exec.sh " ${environment} " ' cat /cluster/eksctl/cluster.yaml /cluster/eksctl/access-entries.yaml | envsubst | eksctl create cluster -f -' &
26+ bash $SCRIPT_DIR /exec.sh " ${environment} " ' cat /cluster/eksctl/cluster.yaml /cluster/eksctl/access-entries.yaml | envsubst | eksctl create cluster -f -' &
27+ pids+=($! )
2528else
2629 echo " Cluster ${EKS_CLUSTER_NAME} already exists"
2730fi
@@ -31,9 +34,12 @@ aws eks describe-cluster --name "${EKS_CLUSTER_AUTO_NAME}" &> /dev/null || auto_
3134
3235if [ $auto_cluster_exists -ne 0 ] && [[ " $cluster " == " auto" || " $cluster " == " all" ]]; then
3336 echo " Creating auto mode cluster ${EKS_CLUSTER_AUTO_NAME} "
34- bash $SCRIPT_DIR /exec.sh " ${environment} " ' cat /cluster/eksctl/cluster-auto.yaml /cluster/eksctl/access-entries.yaml | envsubst | eksctl create cluster -f -' &
37+ bash $SCRIPT_DIR /exec.sh " ${environment} " ' cat /cluster/eksctl/cluster-auto.yaml /cluster/eksctl/access-entries.yaml | envsubst | eksctl create cluster -f -' &
38+ pids+=($! )
3539else
3640 echo " Auto mode cluster ${EKS_CLUSTER_AUTO_NAME} already exists"
3741fi
3842
39- wait
43+ for pid in " ${pids[@]} " ; do
44+ wait " $pid " || exit 1
45+ done
Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ container_image='eks-workshop-environment'
2020(cd $SCRIPT_DIR /../lab && $CONTAINER_CLI build -q -t $container_image .)
2121
2222
23- if [ -z " $ SKIP_CREDENTIALS" -a -z " $ USE_CURRENT_USER" ]; then
23+ if [ " ${ SKIP_CREDENTIALS:- 0} " = " 0 " ] && [ " ${ USE_CURRENT_USER:- 0} " = " 0 " ]; then
2424 echo " Passing temp AWS credentials"
2525 source $SCRIPT_DIR /lib/generate-aws-creds.sh
26- elif [ -n " ${USE_CURRENT_USER:- } " ]; then
26+ elif [ " ${USE_CURRENT_USER:- 0} " != " 0 " ]; then
2727 if [ -z " $AWS_ACCESS_KEY_ID " ]; then
2828 echo " No AWS_ACCESS_KEY_ID found, please check your AWS credentials"
2929 exit 1
You can’t perform that action at this time.
0 commit comments