File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -104,9 +104,6 @@ endif
104
104
ENVTEST_KUBE_VERSION ?= $(KUBE_MINOR ) .x
105
105
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST ) use -p path $(KUBE_MINOR ) .x)
106
106
107
- # Kind node image tags are in the format x.y.z we pin to version x.y.0 because patch releases and node images
108
- # are not guaranteed to be available when a new version of the kube apis is released
109
- KIND_CLUSTER_IMAGE := kindest/node:v$(KUBE_MINOR ) .0
110
107
KIND_CLUSTER_NAME ?= kind-olmv0
111
108
112
109
# Targets #
@@ -224,7 +221,8 @@ kind-clean: $(KIND) #HELP Delete kind cluster $KIND_CLUSTER_NAME (default: kind-
224
221
225
222
.PHONY : kind-create
226
223
kind-create : kind-clean # HELP Create a new kind cluster $KIND_CLUSTER_NAME (default: kind-olmv0)
227
- $(KIND ) create cluster --name $(KIND_CLUSTER_NAME ) --image $(KIND_CLUSTER_IMAGE ) $(KIND_CREATE_OPTS )
224
+ env K8S_VERSION=v$(KUBE_MINOR ) KIND=$(KIND ) GOBIN=$(GOBIN ) hack/tools/validate_kindest_node.sh
225
+ $(KIND ) create cluster --name $(KIND_CLUSTER_NAME ) $(KIND_CREATE_OPTS )
228
226
$(KIND ) export kubeconfig --name $(KIND_CLUSTER_NAME )
229
227
230
228
.PHONY : deploy
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # This script verifies that the version of kind used for testing uses a major.minor version of k8s that operator-controller does
3
+
4
+ # Extract the version of kind, by removing the "${GOBIN}/kind-" prefix
5
+ KIND=${KIND# ${GOBIN} / kind-}
6
+
7
+ # Get the version of the image
8
+ KIND_VER=$( curl -L -s https://github.com/kubernetes-sigs/kind/raw/refs/tags/${KIND} /pkg/apis/config/defaults/image.go | grep -Eo ' v[0-9]+\.[0-9]+' )
9
+
10
+ # Compare the versions
11
+ if [ " ${KIND_VER} " != " ${K8S_VERSION} " ]; then
12
+ echo " kindest/node:${KIND_VER} version does not match k8s ${K8S_VERSION} "
13
+ exit 1
14
+ fi
15
+ exit 0
You can’t perform that action at this time.
0 commit comments