Skip to content

Commit f24ab6f

Browse files
authored
Add missing variables and format scripts (#2330)
Problem: The new variable used in NFR tests was missing from the workflow. Solution: Add missing variables. Also adds shfmt to format the scripts.
1 parent 156f9d8 commit f24ab6f

19 files changed

+135
-110
lines changed

.github/workflows/nfr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ jobs:
123123
working-directory: ./tests
124124
run: |
125125
if ${{ needs.vars.outputs.test_label != 'all' }}; then
126-
sed -i '/^GINKGO_LABEL=/s/=.*/="${{ needs.vars.outputs.test_label }}"/' "scripts/vars.env" && make nfr-test;
126+
sed -i '/^GINKGO_LABEL=/s/=.*/="${{ needs.vars.outputs.test_label }}"/' "scripts/vars.env" && make nfr-test CI=true;
127127
else
128-
make nfr-test;
128+
make nfr-test CI=true;
129129
fi
130130
131131
- name: Upload Artifacts

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ repos:
8181
- --template-files=_templates.gotmpl
8282
- --template-files=README.md.gotmpl
8383

84+
- repo: https://github.com/scop/pre-commit-shfmt
85+
rev: v3.8.0-1
86+
hooks:
87+
- id: shfmt-src
88+
args: [-w, -s, -i, "4"]
89+
8490
ci:
8591
skip: [golangci-lint-full, prettier, markdownlint-cli2, yamllint]
8692
autofix_prs: false

scripts/generate-manifests.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@
55
charts=$(find examples/helm -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)
66

77
generate_manifests() {
8-
chart=$1
9-
manifest=deploy/$chart/deploy.yaml
10-
mkdir -p deploy/$chart
11-
12-
helm_parameters="--namespace nginx-gateway --set nameOverride=nginx-gateway --skip-crds"
13-
if [ "$chart" == "openshift" ]; then
14-
chart="default"
15-
helm_parameters="$helm_parameters --api-versions security.openshift.io/v1/SecurityContextConstraints"
16-
fi
17-
18-
helm template nginx-gateway $helm_parameters --values examples/helm/$chart/values.yaml charts/nginx-gateway-fabric >$manifest 2>/dev/null
19-
sed -i.bak '/app.kubernetes.io\/managed-by: Helm/d' $manifest
20-
sed -i.bak '/helm.sh/d' $manifest
21-
cp $manifest config/base
22-
kubectl kustomize config/base >$manifest
23-
rm -f config/base/deploy.yaml
24-
rm -f $manifest.bak
8+
chart=$1
9+
manifest=deploy/${chart}/deploy.yaml
10+
mkdir -p deploy/${chart}
11+
12+
helm_parameters="--namespace nginx-gateway --set nameOverride=nginx-gateway --skip-crds"
13+
if [ "${chart}" == "openshift" ]; then
14+
chart="default"
15+
helm_parameters="${helm_parameters} --api-versions security.openshift.io/v1/SecurityContextConstraints"
16+
fi
17+
18+
helm template nginx-gateway ${helm_parameters} --values examples/helm/${chart}/values.yaml charts/nginx-gateway-fabric >${manifest} 2>/dev/null
19+
sed -i.bak '/app.kubernetes.io\/managed-by: Helm/d' ${manifest}
20+
sed -i.bak '/helm.sh/d' ${manifest}
21+
cp ${manifest} config/base
22+
kubectl kustomize config/base >${manifest}
23+
rm -f config/base/deploy.yaml
24+
rm -f ${manifest}.bak
2525
}
2626

27-
for chart in $charts; do
28-
generate_manifests $chart
27+
for chart in ${charts}; do
28+
generate_manifests ${chart}
2929
done
3030

3131
# For OpenShift, we don't need a Helm example so we generate the manifests from the default values.yaml
3232
generate_manifests openshift
3333

3434
# FIXME(lucacome): Implement a better way to generate the static deployment file
3535
# https://github.com/nginxinc/nginx-gateway-fabric/issues/2326
36-
helm template nginx-gateway charts/nginx-gateway-fabric --set nameOverride=nginx-gateway --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml > config/tests/static-deployment.yaml
36+
helm template nginx-gateway charts/nginx-gateway-fabric --set nameOverride=nginx-gateway --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml >config/tests/static-deployment.yaml
3737
sed -i.bak '/app.kubernetes.io\/managed-by: Helm/d' config/tests/static-deployment.yaml
3838
sed -i.bak '/helm.sh/d' config/tests/static-deployment.yaml
3939
rm -f config/tests/static-deployment.yaml.bak

tests/reconfig/scripts/create-resources-gw-last.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
num_namespaces=$1
44

55
# Create namespaces
6-
for ((i=1; i<=$num_namespaces; i++)); do
6+
for ((i = 1; i <= num_namespaces; i++)); do
77
namespace_name="namespace$i"
88
kubectl create namespace "$namespace_name"
99
done
@@ -13,13 +13,13 @@ kubectl create -f certificate-ns-and-cafe-secret.yaml
1313
kubectl create -f reference-grant.yaml
1414

1515
# Create backend service and apps
16-
for ((i=1; i<=$num_namespaces; i++)); do
16+
for ((i = 1; i <= num_namespaces; i++)); do
1717
namespace_name="namespace$i"
1818
sed -e "s/coffee/coffee${namespace_name}/g" -e "s/tea/tea${namespace_name}/g" cafe.yaml | kubectl apply -n "$namespace_name" -f -
1919
done
2020

2121
# Create routes
22-
for ((i=1; i<=$num_namespaces; i++)); do
22+
for ((i = 1; i <= num_namespaces; i++)); do
2323
namespace_name="namespace$i"
2424
sed -e "s/coffee/coffee${namespace_name}/g" -e "s/tea/tea${namespace_name}/g" cafe-routes.yaml | kubectl apply -n "$namespace_name" -f -
2525
done

tests/reconfig/scripts/create-resources-routes-last.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
num_namespaces=$1
44

55
# Create namespaces
6-
for ((i=1; i<=$num_namespaces; i++)); do
6+
for ((i = 1; i <= num_namespaces; i++)); do
77
namespace_name="namespace$i"
88
kubectl create namespace "$namespace_name"
99
done
1010

1111
# Create backend service and apps
12-
for ((i=1; i<=$num_namespaces; i++)); do
12+
for ((i = 1; i <= num_namespaces; i++)); do
1313
namespace_name="namespace$i"
1414
sed -e "s/coffee/coffee${namespace_name}/g" -e "s/tea/tea${namespace_name}/g" cafe.yaml | kubectl apply -n "$namespace_name" -f -
1515
done
@@ -23,7 +23,7 @@ kubectl create -f reference-grant.yaml
2323
kubectl create -f gateway.yaml
2424

2525
# Create routes
26-
for ((i=1; i<=$num_namespaces; i++)); do
26+
for ((i = 1; i <= num_namespaces; i++)); do
2727
namespace_name="namespace$i"
2828
sed -e "s/coffee/coffee${namespace_name}/g" -e "s/tea/tea${namespace_name}/g" cafe-routes.yaml | kubectl apply -n "$namespace_name" -f -
2929
done

tests/reconfig/scripts/delete-multiple.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ num_namespaces=$1
44

55
# Delete namespaces
66
namespaces=""
7-
for ((i=1; i<=$num_namespaces; i++)); do
8-
namespaces+="namespace$i "
7+
for ((i = 1; i <= num_namespaces; i++)); do
8+
namespaces+="namespace${i} "
99
done
1010

11-
kubectl delete namespace $namespaces
11+
kubectl delete namespace "${namespaces}"
1212

1313
# Delete single instance resources
1414
kubectl delete -f gateway.yaml
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env bash
22

3+
set -eo pipefail
4+
35
source scripts/vars.env
46

5-
CURRENT_AUTH_NETWORK=$(gcloud container clusters describe ${GKE_CLUSTER_NAME} --zone=${GKE_CLUSTER_ZONE} \
6-
--format="value(masterAuthorizedNetworksConfig.cidrBlocks[0])" | sed 's/cidrBlock=//')
7+
CURRENT_AUTH_NETWORK=$(gcloud container clusters describe "${GKE_CLUSTER_NAME}" --zone="${GKE_CLUSTER_ZONE}" \
8+
--format="value(masterAuthorizedNetworksConfig.cidrBlocks[0])" | sed 's/cidrBlock=//')
79

8-
gcloud container clusters update ${GKE_CLUSTER_NAME} --zone=${GKE_CLUSTER_ZONE} --enable-master-authorized-networks --master-authorized-networks=${SOURCE_IP_RANGE},${CURRENT_AUTH_NETWORK}
10+
gcloud container clusters update "${GKE_CLUSTER_NAME}" --zone="${GKE_CLUSTER_ZONE}" --enable-master-authorized-networks --master-authorized-networks="${SOURCE_IP_RANGE}","${CURRENT_AUTH_NETWORK}"

tests/scripts/check-pod-exit-code.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22

3+
set -eo pipefail
4+
35
CODE=$(kubectl get pod conformance -o jsonpath='{.status.containerStatuses[].state.terminated.exitCode}')
4-
if [ $CODE -ne 0 ]; then
6+
if [ "${CODE}" -ne 0 ]; then
57
exit 2
68
fi

tests/scripts/cleanup-router.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22

3+
set -eo pipefail
4+
35
source scripts/vars.env
46

5-
gcloud compute routers nats delete ${RESOURCE_NAME} --quiet --router ${RESOURCE_NAME} --router-region ${GKE_CLUSTER_REGION}
6-
gcloud compute routers delete ${RESOURCE_NAME} --quiet --region ${GKE_CLUSTER_REGION}
7+
gcloud compute routers nats delete "${RESOURCE_NAME}" --quiet --router "${RESOURCE_NAME}" --router-region "${GKE_CLUSTER_REGION}"
8+
gcloud compute routers delete "${RESOURCE_NAME}" --quiet --region "${GKE_CLUSTER_REGION}"

tests/scripts/cleanup-vm.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/usr/bin/env bash
22

3+
set -eo pipefail
4+
35
source scripts/vars.env
46

57
skip_gke_master_control_node_access="${1:-false}"
68

79
# Remove VM IP from GKE master control node access, if required
8-
if [ ${ADD_VM_IP_AUTH_NETWORKS} = "true" ] && [ ${skip_gke_master_control_node_access} != "true" ]; then
9-
EXTERNAL_IP=$(gcloud compute instances describe ${RESOURCE_NAME} --zone ${GKE_CLUSTER_ZONE} --project=${GKE_PROJECT} --zone=${GKE_CLUSTER_ZONE} \
10-
--format='value(networkInterfaces[0].accessConfigs[0].natIP)')
11-
CURRENT_AUTH_NETWORK=$(gcloud container clusters describe ${GKE_CLUSTER_NAME} --zone ${GKE_CLUSTER_ZONE} \
12-
--format="value(masterAuthorizedNetworksConfig.cidrBlocks[0])" | sed 's/cidrBlock=//')
13-
gcloud container clusters update ${GKE_CLUSTER_NAME} --zone ${GKE_CLUSTER_ZONE} --enable-master-authorized-networks --master-authorized-networks=${CURRENT_AUTH_NETWORK}
10+
if [ "${ADD_VM_IP_AUTH_NETWORKS}" = "true" ] && [ "${skip_gke_master_control_node_access}" != "true" ]; then
11+
CURRENT_AUTH_NETWORK=$(gcloud container clusters describe "${GKE_CLUSTER_NAME}" --zone "${GKE_CLUSTER_ZONE}" \
12+
--format="value(masterAuthorizedNetworksConfig.cidrBlocks[0])" | sed 's/cidrBlock=//')
13+
gcloud container clusters update "${GKE_CLUSTER_NAME}" --zone "${GKE_CLUSTER_ZONE}" --enable-master-authorized-networks --master-authorized-networks="${CURRENT_AUTH_NETWORK}"
1414
fi
1515

16-
gcloud compute instances delete ${RESOURCE_NAME} --quiet --project=${GKE_PROJECT} --zone=${GKE_CLUSTER_ZONE}
17-
gcloud compute firewall-rules delete ${RESOURCE_NAME} --quiet --project=${GKE_PROJECT}
16+
gcloud compute instances delete "${RESOURCE_NAME}" --quiet --project="${GKE_PROJECT}" --zone="${GKE_CLUSTER_ZONE}"
17+
gcloud compute firewall-rules delete "${RESOURCE_NAME}" --quiet --project="${GKE_PROJECT}"

tests/scripts/create-and-setup-gcp-vm.sh

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
#!/usr/bin/env bash
22

3-
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
3+
set -o pipefail
4+
5+
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
46

57
source scripts/vars.env
68

7-
gcloud compute firewall-rules create ${RESOURCE_NAME} \
8-
--project=${GKE_PROJECT} \
9+
gcloud compute firewall-rules create "${RESOURCE_NAME}" \
10+
--project="${GKE_PROJECT}" \
911
--direction=INGRESS \
1012
--priority=1000 \
1113
--network=default \
1214
--action=ALLOW \
1315
--rules=tcp:22 \
14-
--source-ranges=${SOURCE_IP_RANGE} \
15-
--target-tags=${NETWORK_TAGS}
16+
--source-ranges="${SOURCE_IP_RANGE}" \
17+
--target-tags="${NETWORK_TAGS}"
1618

17-
gcloud compute instances create ${RESOURCE_NAME} --project=${GKE_PROJECT} --zone=${GKE_CLUSTER_ZONE} --machine-type=n2-standard-2 \
19+
gcloud compute instances create "${RESOURCE_NAME}" --project="${GKE_PROJECT}" --zone="${GKE_CLUSTER_ZONE}" --machine-type=n2-standard-2 \
1820
--network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default --maintenance-policy=MIGRATE \
19-
--provisioning-model=STANDARD --service-account=${GKE_SVC_ACCOUNT} \
21+
--provisioning-model=STANDARD --service-account="${GKE_SVC_ACCOUNT}" \
2022
--scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append,https://www.googleapis.com/auth/cloud-platform \
21-
--tags=${NETWORK_TAGS} --create-disk=auto-delete=yes,boot=yes,device-name=${RESOURCE_NAME},image-family=projects/${GKE_PROJECT}/global/images/ngf-debian,mode=rw,size=20 --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any
23+
--tags="${NETWORK_TAGS}" --create-disk=auto-delete=yes,boot=yes,device-name="${RESOURCE_NAME}",image-family=projects/"${GKE_PROJECT}"/global/images/ngf-debian,mode=rw,size=20 --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any
2224

2325
# Add VM IP to GKE master control node access, if required
2426
if [ "${ADD_VM_IP_AUTH_NETWORKS}" = "true" ]; then
25-
EXTERNAL_IP=$(gcloud compute instances describe ${RESOURCE_NAME} --project=${GKE_PROJECT} --zone=${GKE_CLUSTER_ZONE} \
26-
--format='value(networkInterfaces[0].accessConfigs[0].natIP)')
27-
CURRENT_AUTH_NETWORK=$(gcloud container clusters describe ${GKE_CLUSTER_NAME} --zone=${GKE_CLUSTER_ZONE} \
28-
--format="value(masterAuthorizedNetworksConfig.cidrBlocks[0])" | sed 's/cidrBlock=//')
29-
gcloud container clusters update ${GKE_CLUSTER_NAME} --zone=${GKE_CLUSTER_ZONE} --enable-master-authorized-networks --master-authorized-networks=${EXTERNAL_IP}/32,${CURRENT_AUTH_NETWORK}
27+
EXTERNAL_IP=$(gcloud compute instances describe "${RESOURCE_NAME}" --project="${GKE_PROJECT}" --zone="${GKE_CLUSTER_ZONE}" \
28+
--format='value(networkInterfaces[0].accessConfigs[0].natIP)')
29+
CURRENT_AUTH_NETWORK=$(gcloud container clusters describe "${GKE_CLUSTER_NAME}" --zone="${GKE_CLUSTER_ZONE}" \
30+
--format="value(masterAuthorizedNetworksConfig.cidrBlocks[0])" | sed 's/cidrBlock=//')
31+
gcloud container clusters update "${GKE_CLUSTER_NAME}" --zone="${GKE_CLUSTER_ZONE}" --enable-master-authorized-networks --master-authorized-networks="${EXTERNAL_IP}"/32,"${CURRENT_AUTH_NETWORK}"
3032
fi
3133

3234
# Poll for SSH connectivity
3335
MAX_RETRIES=10
3436
RETRY_INTERVAL=5
35-
for ((i=1; i<=MAX_RETRIES; i++)); do
37+
for ((i = 1; i <= MAX_RETRIES; i++)); do
3638
echo "Attempt $i to connect to the VM..."
37-
gcloud compute ssh username@${RESOURCE_NAME} --zone=${GKE_CLUSTER_ZONE} --project=${GKE_PROJECT} --quiet --command="echo 'VM is ready'"
39+
gcloud compute ssh username@"${RESOURCE_NAME}" --zone="${GKE_CLUSTER_ZONE}" --project="${GKE_PROJECT}" --quiet --command="echo 'VM is ready'"
3840
if [ $? -eq 0 ]; then
3941
echo "SSH connection successful. VM is ready."
4042
break
@@ -43,18 +45,18 @@ for ((i=1; i<=MAX_RETRIES; i++)); do
4345
sleep ${RETRY_INTERVAL}
4446
done
4547

46-
gcloud compute scp --zone ${GKE_CLUSTER_ZONE} --project=${GKE_PROJECT} ${SCRIPT_DIR}/vars.env username@${RESOURCE_NAME}:~
48+
gcloud compute scp --zone "${GKE_CLUSTER_ZONE}" --project="${GKE_PROJECT}" "${SCRIPT_DIR}"/vars.env username@"${RESOURCE_NAME}":~
4749

4850
if [ -n "${NGF_REPO}" ] && [ "${NGF_REPO}" != "nginxinc" ]; then
49-
gcloud compute ssh --zone ${GKE_CLUSTER_ZONE} --project=${GKE_PROJECT} username@${RESOURCE_NAME} \
50-
--command="bash -i <<EOF
51+
gcloud compute ssh --zone "${GKE_CLUSTER_ZONE}" --project="${GKE_PROJECT}" username@"${RESOURCE_NAME}" \
52+
--command="bash -i <<EOF
5153
rm -rf nginx-gateway-fabric
5254
git clone https://github.com/${NGF_REPO}/nginx-gateway-fabric.git
5355
EOF" -- -t
5456
fi
5557

56-
gcloud compute ssh --zone ${GKE_CLUSTER_ZONE} --project=${GKE_PROJECT} username@${RESOURCE_NAME} \
57-
--command="bash -i <<EOF
58+
gcloud compute ssh --zone "${GKE_CLUSTER_ZONE}" --project="${GKE_PROJECT}" username@"${RESOURCE_NAME}" \
59+
--command="bash -i <<EOF
5860
cd nginx-gateway-fabric/tests
5961
git fetch -pP --all
6062
git checkout ${NGF_BRANCH}

tests/scripts/create-gke-cluster.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env bash
22

3+
set -eo pipefail
4+
35
source scripts/vars.env
46

5-
ip_random_digit=$((1 + $RANDOM % 250))
7+
ip_random_digit=$((1 + RANDOM % 250))
68

79
IS_CI=${1:-false}
810

@@ -16,23 +18,23 @@ if [ -z "$GKE_NUM_NODES" ]; then
1618
GKE_NUM_NODES="3"
1719
fi
1820

19-
gcloud container clusters create ${GKE_CLUSTER_NAME} \
20-
--project ${GKE_PROJECT} \
21-
--zone ${GKE_CLUSTER_ZONE} \
21+
gcloud container clusters create "${GKE_CLUSTER_NAME}" \
22+
--project "${GKE_PROJECT}" \
23+
--zone "${GKE_CLUSTER_ZONE}" \
2224
--enable-master-authorized-networks \
2325
--enable-ip-alias \
24-
--service-account ${GKE_NODES_SERVICE_ACCOUNT} \
26+
--service-account "${GKE_NODES_SERVICE_ACCOUNT}" \
2527
--enable-private-nodes \
2628
--master-ipv4-cidr 172.16.${ip_random_digit}.32/28 \
2729
--metadata=block-project-ssh-keys=TRUE \
2830
--monitoring=SYSTEM,POD,DEPLOYMENT \
2931
--logging=SYSTEM,WORKLOAD \
30-
--machine-type ${GKE_MACHINE_TYPE} \
31-
--num-nodes ${GKE_NUM_NODES} \
32+
--machine-type "${GKE_MACHINE_TYPE}" \
33+
--num-nodes "${GKE_NUM_NODES}" \
3234
--no-enable-insecure-kubelet-readonly-port
3335

3436
# Add current IP to GKE master control node access, if this script is not invoked during a CI run.
3537
if [ "${IS_CI}" = "false" ]; then
36-
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
37-
${SCRIPT_DIR}/add-local-ip-auth-networks.sh
38+
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
39+
"${SCRIPT_DIR}"/add-local-ip-auth-networks.sh
3840
fi

tests/scripts/create-gke-router.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/usr/bin/env bash
22

3+
set -eo pipefail
4+
35
source scripts/vars.env
46

5-
gcloud compute routers create ${RESOURCE_NAME} \
6-
--region ${GKE_CLUSTER_REGION} \
7+
gcloud compute routers create "${RESOURCE_NAME}" \
8+
--region "${GKE_CLUSTER_REGION}" \
79
--network default
810

9-
gcloud compute routers nats create ${RESOURCE_NAME} \
10-
--router-region ${GKE_CLUSTER_REGION} \
11-
--router ${RESOURCE_NAME} \
11+
gcloud compute routers nats create "${RESOURCE_NAME}" \
12+
--router-region "${GKE_CLUSTER_REGION}" \
13+
--router "${RESOURCE_NAME}" \
1214
--nat-all-subnet-ip-ranges \
1315
--auto-allocate-nat-external-ips

tests/scripts/delete-gke-cluster.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -eo pipefail
4+
35
source scripts/vars.env
46

5-
gcloud container clusters delete ${GKE_CLUSTER_NAME} --zone ${GKE_CLUSTER_ZONE} --project ${GKE_PROJECT} --quiet
7+
gcloud container clusters delete "${GKE_CLUSTER_NAME}" --zone "${GKE_CLUSTER_ZONE}" --project "${GKE_PROJECT}" --quiet

tests/scripts/remote-scripts/run-nfr-tests.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
set -e
44

5-
source ~/vars.env
5+
source "${HOME}"/vars.env
66

7-
if [ "$START_LONGEVITY" == "true" ]; then
7+
if [ "${START_LONGEVITY}" == "true" ]; then
88
GINKGO_LABEL="longevity-setup"
9-
elif [ "$STOP_LONGEVITY" == "true" ]; then
9+
elif [ "${STOP_LONGEVITY}" == "true" ]; then
1010
GINKGO_LABEL="longevity-teardown"
1111
fi
1212

13-
cd nginx-gateway-fabric/tests && make .vm-nfr-test TAG=${TAG} PREFIX=${PREFIX} NGINX_PREFIX=${NGINX_PREFIX} NGINX_PLUS_PREFIX=${NGINX_PLUS_PREFIX} PLUS_ENABLED=${PLUS_ENABLED} GINKGO_LABEL=${GINKGO_LABEL} GINKGO_FLAGS=${GINKGO_FLAGS} PULL_POLICY=Always GW_SERVICE_TYPE=LoadBalancer GW_SVC_GKE_INTERNAL=true NGF_VERSION=${NGF_VERSION}
13+
cd nginx-gateway-fabric/tests && make .vm-nfr-test TAG="${TAG}" PREFIX="${PREFIX}" NGINX_PREFIX="${NGINX_PREFIX}" NGINX_PLUS_PREFIX="${NGINX_PLUS_PREFIX}" PLUS_ENABLED="${PLUS_ENABLED}" GINKGO_LABEL=${GINKGO_LABEL} GINKGO_FLAGS="${GINKGO_FLAGS}" PULL_POLICY=Always GW_SERVICE_TYPE=LoadBalancer GW_SVC_GKE_INTERNAL=true NGF_VERSION="${NGF_VERSION}"
1414

15-
if [ "$START_LONGEVITY" == "true" ]; then
15+
if [ "${START_LONGEVITY}" == "true" ]; then
1616
suite/scripts/longevity-wrk.sh
1717
fi

tests/scripts/remote-scripts/run-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -e
44

5-
source ~/vars.env
5+
source "${HOME}"/vars.env
66

7-
cd nginx-gateway-fabric/tests && make test TAG=${TAG} PREFIX=${PREFIX} NGINX_PREFIX=${NGINX_PREFIX} NGINX_PLUS_PREFIX=${NGINX_PLUS_PREFIX} PLUS_ENABLED=${PLUS_ENABLED} GINKGO_LABEL=${GINKGO_LABEL} GINKGO_FLAGS=${GINKGO_FLAGS} PULL_POLICY=Always GW_SERVICE_TYPE=LoadBalancer GW_SVC_GKE_INTERNAL=true NGF_VERSION=${NGF_VERSION}
7+
cd nginx-gateway-fabric/tests && make test TAG="${TAG}" PREFIX="${PREFIX}" NGINX_PREFIX="${NGINX_PREFIX}" NGINX_PLUS_PREFIX="${NGINX_PLUS_PREFIX}" PLUS_ENABLED="${PLUS_ENABLED}" GINKGO_LABEL="${GINKGO_LABEL}" GINKGO_FLAGS="${GINKGO_FLAGS}" PULL_POLICY=Always GW_SERVICE_TYPE=LoadBalancer GW_SVC_GKE_INTERNAL=true NGF_VERSION="${NGF_VERSION}"

0 commit comments

Comments
 (0)