Skip to content

Commit 34e7e7e

Browse files
committed
Pass region to AWS CLI
1 parent 9505cb1 commit 34e7e7e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • tests/e2e/scenarios/aws-lb-controller

tests/e2e/scenarios/aws-lb-controller/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ set -o pipefail
2121
# Get the cluster name from the KUBECONFIG context
2222
CLUSTER_NAME=$(kubectl config view --minify -o jsonpath='{.clusters[0].name}')
2323

24-
# Get VPC ID by looking at the cluster's subnet
25-
VPC=$(kubectl get nodes -o jsonpath='{.items[0].spec.providerID}' | cut -d'/' -f5 | xargs -I{} aws ec2 describe-instances --instance-ids {} --query 'Reservations[0].Instances[0].VpcId' --output text)
26-
2724
# Get the zone from a node
2825
ZONE=$(kubectl get nodes -o jsonpath='{.items[0].metadata.labels.topology\.kubernetes\.io/zone}')
2926
REGION=${ZONE%?}
3027

28+
# Get VPC ID by looking at the cluster's subnet
29+
VPC=$(kubectl get nodes -o jsonpath='{.items[0].spec.providerID}' | cut -d'/' -f5 | xargs -I{} aws --region "${REGION}" ec2 describe-instances --instance-ids {} --query 'Reservations[0].Instances[0].VpcId' --output text)
30+
3131
REPORT_DIR="${ARTIFACTS:-$(pwd)/_artifacts}/aws-lb-controller"
3232
mkdir -p "${REPORT_DIR}"
3333

0 commit comments

Comments
 (0)