forked from ava-labs/avalanchego
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.load.kube.kind.sh
More file actions
executable file
·36 lines (28 loc) · 1.16 KB
/
Copy pathtests.load.kube.kind.sh
File metadata and controls
executable file
·36 lines (28 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -euo pipefail
# Run load test against nodes deployed to a kind cluster
if ! [[ "$0" =~ scripts/tests.load.kube.kind.sh ]]; then
echo "must be run from repository root"
exit 255
fi
# This script will use kubeconfig arguments if supplied
./scripts/start_kind_cluster.sh "$@"
# Build AvalancheGo image
AVALANCHEGO_IMAGE="localhost:5001/avalanchego"
if [[ -n "${SKIP_BUILD_IMAGE:-}" ]]; then
echo "Skipping build of avalanchego image due to SKIP_BUILD_IMAGE=${SKIP_BUILD_IMAGE}"
else
DOCKER_IMAGE="$AVALANCHEGO_IMAGE" FORCE_TAG_MASTER=1 ./scripts/build_image.sh
fi
# Determine kubeconfig context to use
KUBECONFIG_CONTEXT=""
# Check if --kubeconfig-context is already provided in arguments
if [[ "$*" =~ --kubeconfig-context ]]; then
# User provided a context, use it as-is
echo "Using provided kubeconfig context from arguments"
else
# Default to the RBAC context
KUBECONFIG_CONTEXT="--kubeconfig-context=kind-kind-tmpnet"
echo "Defaulting to limited-permission context 'kind-kind-tmpnet' to test RBAC Role permissions"
fi
go run ./tests/load/main --runtime=kube --kube-image="$AVALANCHEGO_IMAGE:master" "$KUBECONFIG_CONTEXT" "$@"