1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
node-feature-discovery/scripts/test-infra/test-e2e-presubmit.sh
Markus Lehtonen fb2b1926f6 scripts: refresh e2e-presubmit test script
Update and simplify.
2024-07-05 14:51:13 +03:00

33 lines
997 B
Bash
Executable file

#!/bin/bash -e
set -o pipefail
# Configure environment
export KIND_VERSION="v0.23.0"
export KIND_NODE_IMAGE="kindest/node:v1.30.2"
export CLUSTER_NAME="nfd-e2e"
export KUBECONFIG="/tmp/kubeconfig_$CLUSTER_NAME"
export IMAGE_REPO="registry.local/node-feature-discovery"
export IMAGE_TAG_NAME=$(git describe --tags --dirty --always)
# 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
# build the local image
make image IMAGE_REPO=$IMAGE_REPO IMAGE_TAG_NAME=$IMAGE_TAG_NAME
# push the image to the local registry
kind load docker-image $IMAGE_REPO:$IMAGE_TAG_NAME --name $CLUSTER_NAME
# run the tests
make e2e-test IMAGE_REPO=$IMAGE_REPO IMAGE_TAG_NAME=$IMAGE_TAG_NAME E2E_PULL_IF_NOT_PRESENT=true