Skip to content

Commit fb9176d

Browse files
authored
Merge pull request #3213 from oliviassss/refactor-e2e-script
add TEST_IMAGE_REGISTRY to e2e script
2 parents 2535aaa + 77af1c3 commit fb9176d

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

scripts/run-e2e-test.sh

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@ GINKGO_TEST_BUILD="$SCRIPT_DIR/../test/build"
99

1010
source "$SCRIPT_DIR"/lib/common.sh
1111

12-
# the corresponding accounts for AWS isolated regions
13-
BJS_PREFIX="918309763551.dkr.ecr.cn-north-1.amazonaws.com.cn"
14-
ZHY_PREFIX="961992271922.dkr.ecr.cn-northwest-1.amazonaws.com.cn"
15-
DCA_PREFIX="639420080494.dkr.ecr.us-iso-east-1.c2s.ic.gov"
16-
LCK_PREFIX="517467847110.dkr.ecr.us-isob-east-1.sc2s.sgov.gov"
12+
# set the test image registry
13+
TEST_IMAGE_REGISTRY=${TEST_IMAGE_REGISTRY:-"602401143452.dkr.ecr.us-west-2.amazonaws.com"}
1714

1815
function toggle_windows_scheduling(){
1916
schedule=$1
@@ -32,17 +29,17 @@ function cleanUp(){
3229
# Need to recreae aws-load-balancer controller if we are updating SA
3330
echo "delete aws-load-balancer-controller if exists"
3431
helm delete aws-load-balancer-controller -n kube-system --timeout=10m || true
35-
32+
3633
echo "delete service account if exists"
3734
kubectl delete serviceaccount aws-load-balancer-controller -n kube-system --timeout 10m || true
38-
35+
3936
# IAM role and polcies are AWS Account specific, so need to clean them up if any from previous run
4037
echo "detach IAM policy if it exists"
4138
aws iam detach-role-policy --role-name $ROLE_NAME --policy-arn arn:${AWS_PARTITION}:iam::$ACCOUNT_ID:policy/AWSLoadBalancerControllerIAMPolicy || true
4239

4340
# wait for 10 sec to complete detaching of IAM policy
4441
sleep 10
45-
42+
4643
echo "delete $ROLE_NAME if it exists"
4744
aws iam delete-role --role-name $ROLE_NAME || true
4845

@@ -66,19 +63,7 @@ if [[ $REGION == "cn-north-1" || $REGION == "cn-northwest-1" ]];then
6663
IAM_POLCIY_FILE="iam_policy_cn.json"
6764
fi
6865

69-
if [[ $REGION == "cn-north-1" ]];then
70-
PREFIX=$BJS_PREFIX
71-
elif [[ $REGION == "cn-northwest-1" ]];then
72-
PREFIX=$ZHY_PREFIX
73-
elif [[ $REGION == "us-iso-east-1" ]];then
74-
PREFIX=$DCA_PREFIX
75-
elif [[ $REGION == "us-isob-east-1" ]];then
76-
PREFIX=$LCK_PREFIX
77-
else
78-
PREFIX="602401143452.dkr.ecr.us-west-2.amazonaws.com"
79-
fi
80-
IMAGE="$PREFIX/amazon/aws-load-balancer-controller"
81-
66+
IMAGE="$TEST_IMAGE_REGISTRY/amazon/aws-load-balancer-controller"
8267
echo "IMAGE: $IMAGE"
8368
echo "create IAM policy document file"
8469
cat <<EOF > trust.json

0 commit comments

Comments
 (0)