Skip to content

Commit 3c08244

Browse files
committed
remove unnecessary cleanup in prow script
1 parent e619a48 commit 3c08244

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

scripts/run-e2e-test.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ echo "TEST_ID: $TEST_ID"
3131
ROLE_NAME="aws-load-balancer-controller-$TEST_ID"
3232

3333
function cleanUp(){
34-
# Need to recreae aws-load-balancer controller if we are updating SA
35-
echo "delete aws-load-balancer-controller if exists"
36-
helm delete aws-load-balancer-controller -n kube-system --timeout=10m || true
37-
38-
echo "delete service account if exists"
39-
kubectl delete serviceaccount aws-load-balancer-controller -n kube-system --timeout 10m || true
40-
4134
# IAM role and polcies are AWS Account specific, so need to clean them up if any from previous run
4235
echo "detach IAM policy if it exists"
4336
aws iam detach-role-policy --role-name $ROLE_NAME --policy-arn arn:${AWS_PARTITION}:iam::$ACCOUNT_ID:policy/AWSLoadBalancerControllerIAMPolicy || true
@@ -104,9 +97,6 @@ cat <<EOF > trust.json
10497
}
10598
EOF
10699

107-
echo "cleanup any stale resources from previous run"
108-
cleanUp
109-
110100
echo "create Role with above policy document"
111101
aws iam create-role --role-name $ROLE_NAME --assume-role-policy-document file://trust.json --description "IAM Role to be used by aws-load-balancer-controller SA" || true
112102

@@ -217,6 +207,13 @@ kubectl logs -l app.kubernetes.io/name=aws-load-balancer-controller --container
217207
echo "Uncordon windows nodes"
218208
toggle_windows_scheduling "uncordon"
219209

210+
echo "uninstalling aws load balancer controller"
211+
if [[ $ADC_REGIONS == *"$REGION"* ]]; then
212+
kubectl delete -f $controller_yaml --timeout=60s || true
213+
kubectl delete -f $cert_manager_yaml --timeout=60s || true
214+
else
215+
helm uninstall aws-load-balancer-controller -n kube-system --timeout=60s || true
216+
fi
220217
echo "clean up resources from current run"
221218
cleanUp
222219

0 commit comments

Comments
 (0)