Skip to content

Commit

Permalink
make sure we're using the latest kind node image
Browse files Browse the repository at this point in the history
Signed-off-by: Per Goncalves da Silva <[email protected]>
  • Loading branch information
Per Goncalves da Silva committed Jun 26, 2024
1 parent 3efd226 commit fe0d3aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use -p path $(KUBE_MINOR).x)

# Kind node image tags are in the format x.y.z we pin to version x.y.0 because patch releases and node images
# are not guaranteed to be available when a new version of the kube apis is released
KIND_CLUSTER_IMAGE := kindest/node:v$(KUBE_MINOR).0
export KIND_CLUSTER_IMAGE := kindest/node:v$(KUBE_MINOR).0
export KIND_CLUSTER_NAME ?= kind-olmv0

# Targets #
Expand Down
9 changes: 8 additions & 1 deletion scripts/kind_with_registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
set -o errexit
set -x

BINGO_ENV_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.bingo" && pwd)

. "${BINGO_ENV_PATH}/variables.env"

# Original source: https://kind.sigs.k8s.io/docs/user/local-registry/
KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME:-kind-olmv0}
KIND=${KIND:-kind}
Expand All @@ -25,7 +29,10 @@ fi
# https://github.com/kubernetes-sigs/kind/issues/2875
# https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration
# See: https://github.com/containerd/containerd/blob/main/docs/hosts.md
cat <<EOF | ${KIND} create cluster --name="${KIND_CLUSTER_NAME}" ${KIND_CREATE_OPTS} --config=-
if [ -n "${KIND_CLUSTER_IMAGE}" ]; then
KIND_IMAGE="--image=${KIND_CLUSTER_IMAGE}"
fi
cat <<EOF | ${KIND} create cluster --name="${KIND_CLUSTER_NAME}" "${KIND_IMAGE}" ${KIND_CREATE_OPTS} --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
Expand Down

0 comments on commit fe0d3aa

Please sign in to comment.