Skip to content

Commit

Permalink
Fix reset environment ASG resize missing cluster name for filter
Browse files Browse the repository at this point in the history
  • Loading branch information
niallthomson committed Nov 19, 2023
1 parent cce5f56 commit 41a8077
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lab/bin/reset-environment
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ if [[ "$mng_size_config" != "$expected_size_config" ]]; then
sleep 10
fi

asg_size_config=$(aws autoscaling describe-auto-scaling-groups --filters "Name=tag:eks:nodegroup-name,Values=$EKS_DEFAULT_MNG_NAME" | jq -r '.AutoScalingGroups[0] | "\(.MinSize) \(.MaxSize) \(.DesiredCapacity)"')
asg_size_config=$(aws autoscaling describe-auto-scaling-groups --filters "Name=tag:eks:nodegroup-name,Values=$EKS_DEFAULT_MNG_NAME" "Name=tag:eks:cluster-name,Values=$EKS_CLUSTER_NAME" | jq -r '.AutoScalingGroups[0] | "\(.MinSize) \(.MaxSize) \(.DesiredCapacity)"')

if [[ "$asg_size_config" != "$expected_size_config" ]]; then
echo "Setting ASG back to initial sizing..."

export ASG_NAME=$(aws autoscaling describe-auto-scaling-groups --filters "Name=tag:eks:nodegroup-name,Values=$EKS_DEFAULT_MNG_NAME" --query "AutoScalingGroups[0].AutoScalingGroupName" --output text)
export ASG_NAME=$(aws autoscaling describe-auto-scaling-groups --filters "Name=tag:eks:nodegroup-name,Values=$EKS_DEFAULT_MNG_NAME" "Name=tag:eks:cluster-name,Values=$EKS_CLUSTER_NAME" --query "AutoScalingGroups[0].AutoScalingGroupName" --output text)
aws autoscaling update-auto-scaling-group \
--auto-scaling-group-name $ASG_NAME \
--min-size $EKS_DEFAULT_MNG_MIN \
Expand Down

0 comments on commit 41a8077

Please sign in to comment.