2020-08-20 16:03:26 +00:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
# Configure environment
|
2024-07-08 10:38:38 +00:00
|
|
|
export KIND_VERSION="v0.23.0"
|
|
|
|
export KIND_NODE_IMAGE="kindest/node:v1.30.2"
|
|
|
|
export CLUSTER_NAME="nfd-e2e"
|
2020-08-20 16:03:26 +00:00
|
|
|
export KUBECONFIG=`pwd`/kubeconfig
|
2024-07-08 10:38:38 +00:00
|
|
|
export IMAGE_REGISTRY="gcr.io/k8s-staging-nfd"
|
2023-12-05 15:45:12 +00:00
|
|
|
export E2E_TEST_FULL_IMAGE=true
|
2020-08-20 16:03:26 +00:00
|
|
|
|
2024-07-09 06:13:49 +00:00
|
|
|
# Install kind
|
|
|
|
go install sigs.k8s.io/kind@$KIND_VERSION
|
|
|
|
|
|
|
|
# create a cluster with the local registry enabled in containerd
|
|
|
|
cat <<EOF | kind create cluster --kubeconfig $KUBECONFIG --image $KIND_NODE_IMAGE --config=-
|
|
|
|
kind: Cluster
|
|
|
|
apiVersion: kind.x-k8s.io/v1alpha4
|
|
|
|
name: $CLUSTER_NAME
|
|
|
|
nodes:
|
|
|
|
- role: control-plane
|
|
|
|
- role: worker
|
|
|
|
- role: worker
|
|
|
|
EOF
|
|
|
|
|
2020-08-20 16:03:26 +00:00
|
|
|
# Wait for the image to be built and published
|
|
|
|
i=1
|
|
|
|
while true; do
|
2021-03-09 10:13:02 +00:00
|
|
|
if make poll-images; then
|
2020-08-20 16:03:26 +00:00
|
|
|
break
|
2024-07-09 09:35:33 +00:00
|
|
|
elif [ $i -ge 55 ]; then
|
2021-12-02 08:51:28 +00:00
|
|
|
echo "ERROR: too many tries when polling for image"
|
2020-08-20 16:03:26 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-01-21 08:39:47 +00:00
|
|
|
sleep 60
|
2020-08-20 16:03:26 +00:00
|
|
|
|
|
|
|
i=$(( $i + 1 ))
|
|
|
|
done
|
|
|
|
|
|
|
|
# Configure environment and run tests
|
2020-09-15 08:53:50 +00:00
|
|
|
make e2e-test
|