Skip to content

Commit 1fd09b7

Browse files
author
Chinmay Gadgil
committed
renamed file
Addressed PR comments
1 parent 0895b9e commit 1fd09b7

File tree

1 file changed

+12
-25
lines changed

1 file changed

+12
-25
lines changed

test/e2e/run.sh renamed to test/e2e/run-canary-test.sh

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,34 @@ if [[ -z "${OS_OVERRIDE}" ]]; then
1515
OS_OVERRIDE=linux
1616
fi
1717

18-
CLUSTER_INFO=$(aws eks describe-cluster --name $CLUSTER_NAME --region $REGION)
18+
GET_CLUSTER_INFO_CMD="aws eks describe-cluster --name $CLUSTER_NAME --region $REGION"
19+
20+
if [[ -z "${ENDPOINT}" ]]; then
21+
CLUSTER_INFO=$($GET_CLUSTER_INFO_CMD)
22+
else
23+
CLUSTER_INFO=$($GET_CLUSTER_INFO_CMD --endpoint $ENDPOINT)
24+
fi
1925

2026
VPC_ID=$(echo $CLUSTER_INFO | jq -r '.cluster.resourcesVpcConfig.vpcId')
2127
SERVICE_ROLE_ARN=$(echo $CLUSTER_INFO | jq -r '.cluster.roleArn')
2228
ROLE_NAME=${SERVICE_ROLE_ARN##*/}
23-
2429
ACCOUNT_ID=$(aws sts get-caller-identity | jq -r '.Account')
2530

2631
echo "VPC ID: $VPC_ID, Service Role ARN: $SERVICE_ROLE_ARN, Role Name: $ROLE_NAME"
2732

28-
# Set up local resources
29-
echo "Attaching IAM Policy to Cluster Service Role"
30-
aws iam attach-role-policy \
31-
--policy-arn arn:aws:iam::aws:policy/AmazonEKSVPCResourceController \
32-
--role-name "$ROLE_NAME" > /dev/null
33-
34-
echo "Enabling Pod ENI on aws-node"
35-
kubectl set env daemonset aws-node -n kube-system ENABLE_POD_ENI=true
36-
3733
eksctl utils associate-iam-oidc-provider \
3834
--region $REGION \
3935
--cluster $CLUSTER_NAME \
4036
--approve
4137

42-
echo "Create AWSLoadbalancerController IAM Policy"
38+
echo "Creating AWSLoadbalancerController IAM Policy"
4339
curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.2.1/docs/install/iam_policy.json
4440

4541
aws iam create-policy \
4642
--policy-name AWSLoadBalancerControllerIAMPolicy \
4743
--policy-document file://iam-policy.json || true
4844

49-
echo "Create IAM serviceaccount"
45+
echo "Creating IAM serviceaccount"
5046
eksctl create iamserviceaccount \
5147
--cluster=$CLUSTER_NAME \
5248
--namespace=kube-system \
@@ -71,22 +67,13 @@ echo "Starting the ginkgo test suite"
7167

7268
(cd $SCRIPT_DIR && CGO_ENABLED=0 GOOS=$OS_OVERRIDE ginkgo -v -r -- --kubeconfig=$KUBE_CONFIG_PATH --cluster-name=$CLUSTER_NAME --aws-region=$REGION --aws-vpc-id=$VPC_ID || true)
7369

74-
echo "Successfully finished the test suite"
75-
76-
#Tear down local resources
77-
echo "Detaching the IAM Policy from Cluster Service Role"
78-
aws iam detach-role-policy \
79-
--policy-arn arn:aws:iam::aws:policy/AmazonEKSVPCResourceController \
80-
--role-name $ROLE_NAME || true
81-
82-
echo "Disabling Pod ENI on aws-node"
83-
kubectl set env daemonset aws-node -n kube-system ENABLE_POD_ENI=false
70+
echo "Delete aws-load-balacner-controller"
71+
helm delete aws-load-balancer-controller -n kube-system
8472

8573
echo "Delete iamserviceaccount"
8674
eksctl delete iamserviceaccount --name aws-load-balancer-controller --namespace kube-system --cluster $CLUSTER_NAME || true
8775

8876
echo "Delete TargetGroupBinding CRDs"
8977
kubectl delete -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller//crds?ref=master"
9078

91-
echo "Delete aws-load-balacner-controller"
92-
helm delete aws-load-balancer-controller -n kube-system
79+
echo "Successfully finished the test suite"

0 commit comments

Comments
 (0)