@@ -7,10 +7,16 @@ set -euox pipefail
77KIND_CLUSTER_NAME=" ${KIND_CLUSTER_NAME:- tb-e2e} "
88KUBECONFIG_PATH=" ${KUBECONFIG_PATH:- $(pwd)/ kubeconfig} "
99TEST_YAML=" ${TEST_YAML:- e2e-testconfig.yaml} "
10- TOOL_IMAGE=" ${TOOL_IMAGE:- tiger-bench: v0.5.0} "
1110CALICO_VERSION=" ${CALICO_VERSION:- v3.30.2} "
1211REGISTRY=" ${REGISTRY:- quay.io} "
1312ORGANISATION=" ${ORGANISATION:- tigeradev} "
13+ # VERSION can be set by the Makefile; default to v0.5.0 for local runs.
14+ VERSION=" ${VERSION:- v0.5.0} "
15+ # Default image names (Makefile will pass explicit image names including tags).
16+ TOOL_IMAGE=" ${TOOL_IMAGE:- $REGISTRY / $ORGANISATION / tiger-bench: ${VERSION} } "
17+ PERF_IMAGE=" ${PERF_IMAGE:- $REGISTRY / $ORGANISATION / tiger-bench-perf: ${VERSION} } "
18+ WEBSERVER_IMAGE=" ${WEBSERVER_IMAGE:- $REGISTRY / $ORGANISATION / tiger-bench-nginx: ${VERSION} } "
19+ TTFR_IMAGE=" ${TTFR_IMAGE:- $REGISTRY / $ORGANISATION / tiger-bench-ttfr: ${VERSION} } "
1420
1521kind create cluster --kubeconfig " $KUBECONFIG_PATH " --config kind-config.yaml || true
1622
@@ -19,10 +25,18 @@ curl --retry 10 --retry-all-errors -sSL https://raw.githubusercontent.com/projec
1925curl --retry 10 --retry-all-errors -sSL https://raw.githubusercontent.com/projectcalico/calico/$CALICO_VERSION /manifests/tigera-operator.yaml | kubectl --kubeconfig " $KUBECONFIG_PATH " apply --server-side --force-conflicts -f -
2026curl --retry 10 --retry-all-errors -sSL https://raw.githubusercontent.com/projectcalico/calico/$CALICO_VERSION /manifests/custom-resources.yaml | kubectl --kubeconfig " $KUBECONFIG_PATH " apply --server-side --force-conflicts -f -
2127
22- # Load test images into KinD nodes
23- for img in tiger-bench-perf tiger-bench-nginx tiger-bench-ttfr; do
24- docker image inspect " $REGISTRY /$ORGANISATION /$img :v0.5.0" > /dev/null 2>&1 || { echo " Image $img not found" ; exit 1; }
25- kind load docker-image " $REGISTRY /$ORGANISATION /$img :v0.5.0" --name " $KIND_CLUSTER_NAME "
28+ # Load test images into KinD nodes. The Makefile must pass the explicit
29+ # image names that were built; be strict and fail if an image is missing so
30+ # the test is explicit about what it's validating.
31+ images=(" $WEBSERVER_IMAGE " " $PERF_IMAGE " " $TTFR_IMAGE " )
32+ for img in " ${images[@]} " ; do
33+ if docker image inspect " $img " > /dev/null 2>&1 ; then
34+ kind load docker-image " $img " --name " $KIND_CLUSTER_NAME "
35+ else
36+ echo " Required image not found locally: $img "
37+ echo " Build the images via 'make build' or set the image variables when running this script."
38+ exit 1
39+ fi
2640done
2741
2842# Wait for nodes to be ready
@@ -37,14 +51,21 @@ kubectl --kubeconfig "$KUBECONFIG_PATH" wait --for=condition=Available tigerasta
3751
3852# Run tiger-bench container with kubeconfig and test yaml
3953# Assumes testconfig.yaml is present in the repo root
54+ # Require the exact tool image be present locally (Makefile must pass it).
55+ if ! docker image inspect " $TOOL_IMAGE " > /dev/null 2>&1 ; then
56+ echo " Tool image not found locally: $TOOL_IMAGE "
57+ echo " Build the tool image via 'make tool' or pass TOOL_IMAGE explicitly."
58+ exit 1
59+ fi
60+
4061docker run --rm --net=host \
4162 -v " ${PWD} " :/results \
4263 -v " $KUBECONFIG_PATH :/kubeconfig:ro" \
43- -v " $( pwd ) /$TEST_YAML :/testconfig.yaml:ro" \
44- -e WEBSERVER_IMAGE=" $REGISTRY / $ORGANISATION /tiger-bench-nginx:v0.5.0 " \
45- -e PERF_IMAGE=" $REGISTRY / $ORGANISATION /tiger-bench-perf:v0.5.0 " \
46- -e TTFR_IMAGE=" $REGISTRY / $ORGANISATION /tiger-bench-ttfr:v0.5.0 " \
47- " $REGISTRY / $ORGANISATION / $ TOOL_IMAGE"
64+ -v " ${PWD} /$TEST_YAML :/testconfig.yaml:ro" \
65+ -e WEBSERVER_IMAGE=" $WEBSERVER_IMAGE " \
66+ -e PERF_IMAGE=" $PERF_IMAGE " \
67+ -e TTFR_IMAGE=" $TTFR_IMAGE " \
68+ " $TOOL_IMAGE "
4869
4970# Validate the results file
5071go run validate_results.go
0 commit comments