2020-08-20 19:03:26 +03:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
# Configure environment
|
2024-07-08 13:38:38 +03:00
|
|
|
export KIND_VERSION="v0.23.0"
|
|
|
|
export KIND_NODE_IMAGE="kindest/node:v1.30.2"
|
|
|
|
export CLUSTER_NAME="nfd-e2e"
|
2020-08-20 19:03:26 +03:00
|
|
|
export KUBECONFIG=`pwd`/kubeconfig
|
2024-07-08 13:38:38 +03:00
|
|
|
export IMAGE_REGISTRY="gcr.io/k8s-staging-nfd"
|
2023-12-05 16:45:12 +01:00
|
|
|
export E2E_TEST_FULL_IMAGE=true
|
2020-08-20 19:03:26 +03:00
|
|
|
|
2024-07-09 09:13:49 +03: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 19:03:26 +03:00
|
|
|
# Wait for the image to be built and published
|
|
|
|
i=1
|
|
|
|
while true; do
|
2021-03-09 12:13:02 +02:00
|
|
|
if make poll-images; then
|
2020-08-20 19:03:26 +03:00
|
|
|
break
|
2024-07-09 12:35:33 +03:00
|
|
|
elif [ $i -ge 55 ]; then
|
2021-12-02 10:51:28 +02:00
|
|
|
echo "ERROR: too many tries when polling for image"
|
2020-08-20 19:03:26 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-01-21 10:39:47 +02:00
|
|
|
sleep 60
|
2020-08-20 19:03:26 +03:00
|
|
|
|
|
|
|
i=$(( $i + 1 ))
|
|
|
|
done
|
|
|
|
|
|
|
|
# Configure environment and run tests
|
2020-09-15 11:53:50 +03:00
|
|
|
make e2e-test
|