Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/kubernetes/scripts/create_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ case "$PROVIDER" in
echo "Node Count: $NODE_COUNT"
echo "Instance Type: $INSTANCE_TYPE"

# Check if cluster exists and delete it if present
echo "Checking if EKS cluster '$CLUSTER_NAME' exists..."
set +e
aws eks describe-cluster --region "$REGION" --name "$CLUSTER_NAME" > /dev/null 2>&1
cluster_exists=$?
set -e

if [ $cluster_exists -eq 0 ]; then
echo "Found existing EKS cluster '$CLUSTER_NAME'. Deleting it first..."
# Get the directory where this script is located to find delete_cluster.sh
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
"$SCRIPT_DIR/delete_cluster.sh" aws "$CLUSTER_NAME" "$REGION"
echo "Waiting for cluster deletion to complete before creating new cluster..."
else
echo "No existing EKS cluster found"
fi

RESOLVED_CONFIG="/tmp/${CLUSTER_NAME}-eks-cluster-config.yaml"
cat > "$RESOLVED_CONFIG" <<EOF
apiVersion: eksctl.io/v1alpha5
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke_tests/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def test_helm_deploy_eks(request):
f'bash tests/kubernetes/scripts/helm_upgrade.sh {package_name} {helm_version} aws',
],
# EKS termination requires longer timeout.
timeout=50 * 60)
timeout=90 * 60)
smoke_tests_utils.run_one_test(test)


Expand Down
Loading