@@ -23,8 +23,8 @@ KIND_NETWORK ?= remote-controller
2323
2424TIMEOUT = 30m
2525
26- KIND_VERSION = v0.25 .0
27- KUBECTL_VERSION := v1.31.0
26+ KIND_VERSION = v0.27 .0
27+ KUBECTL_VERSION := v1.32.3
2828HELM_VERSION := v3.16.1
2929GOJQ_VERSION = v0.12.16
3030KUSTOMIZE_VERSION := v5.4.3
@@ -42,7 +42,7 @@ ARCH := $(shell uname | tr '[:upper:]' '[:lower:]')
4242local-dev/kind :
4343ifeq ($(KIND_VERSION ) , $(shell kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+) .*/\1/p'))
4444 $(info linking local kind version $(KIND_VERSION))
45- ln -sf $( shell command -v kind) ./local-dev/kind
45+ $(eval KIND = $(realpath $( shell command -v kind)))
4646else
4747ifneq ($(KIND_VERSION ) , $(shell ./local-dev/kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+) .*/\1/p'))
4848 $(info downloading kind version $(KIND_VERSION) for $(ARCH))
@@ -57,10 +57,11 @@ endif
5757local-dev/kustomize :
5858ifeq ($(KUSTOMIZE_VERSION ) , $(shell kustomize version 2>/dev/null | sed -nE 's/(v[0-9.]+) .*/\1/p'))
5959 $(info linking local kustomize version $(KUSTOMIZE_VERSION))
60- ln -sf $( shell command -v kind) ./local-dev/kind
60+ $(eval KUSTOMIZE = $(realpath $( shell command -v kustomize)))
6161else
6262ifneq ($(KUSTOMIZE_VERSION ) , $(shell ./local-dev/kustomize version 2>/dev/null | sed -nE 's/(v[0-9.]+) .*/\1/p'))
6363 $(info downloading kustomize version $(KUSTOMIZE_VERSION) for $(ARCH))
64+ mkdir -p local-dev
6465 rm local-dev/kustomize || true
6566 curl -sSL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F$(KUSTOMIZE_VERSION)/kustomize_$(KUSTOMIZE_VERSION)_$(ARCH)_amd64.tar.gz | tar -xzC local-dev
6667 chmod a+x local-dev/kustomize
@@ -71,10 +72,11 @@ endif
7172local-dev/helm :
7273ifeq ($(HELM_VERSION ) , $(shell helm version --short --client 2>/dev/null | sed -nE 's/(v[0-9.]+) .*/\1/p'))
7374 $(info linking local helm version $(HELM_VERSION))
74- ln -sf $( shell command -v helm) ./local-dev/helm
75+ $(eval HELM = $(realpath $( shell command -v helm)))
7576else
7677ifneq ($(HELM_VERSION ) , $(shell ./local-dev/helm version --short --client 2>/dev/null | sed -nE 's/(v[0-9.]+) .*/\1/p'))
7778 $(info downloading helm version $(HELM_VERSION) for $(ARCH))
79+ mkdir -p local-dev
7880 rm local-dev/helm || true
7981 curl -sSL https://get.helm.sh/helm-$(HELM_VERSION)-$(ARCH)-amd64.tar.gz | tar -xzC local-dev --strip-components=1 $(ARCH)-amd64/helm
8082 chmod a+x local-dev/helm
@@ -86,9 +88,11 @@ local-dev/jq:
8688ifeq ($(GOJQ_VERSION ) , $(shell gojq -v 2>/dev/null | sed -nE 's/gojq ([0-9.]+) .*/v\1/p'))
8789 $(info linking local gojq version $(GOJQ_VERSION))
8890 ln -sf $(shell command -v gojq) ./local-dev/jq
91+ $(eval JQ = $(realpath $(shell command -v gojq)))
8992else
9093ifneq ($(GOJQ_VERSION ) , $(shell ./local-dev/jq -v 2>/dev/null | sed -nE 's/gojq ([0-9.]+) .*/v\1/p'))
9194 $(info downloading gojq version $(GOJQ_VERSION) for $(ARCH))
95+ mkdir -p local-dev
9296 rm local-dev/jq || true
9397ifeq ($(ARCH ) , darwin)
9498 TMPDIR=$$(mktemp -d) \
@@ -106,12 +110,13 @@ endif
106110local-dev/kubectl :
107111ifeq ($(KUBECTL_VERSION ) , $(shell kubectl version --client 2>/dev/null | grep Client | sed -E 's/Client Version : (v[0-9.]+).* /\1/'))
108112 $(info linking local kubectl version $(KUBECTL_VERSION ) )
109- ln -sf $( shell command -v kubectl) ./local-dev/kubectl
113+ $( eval KUBECTL = $( realpath $( shell command -v kubectl)) )
110114else
111115ifneq ($(KUBECTL_VERSION ) , $(shell ./local-dev/kubectl version --client 2>/dev/null | grep Client | sed -E 's/Client Version : (v[0-9.]+).* /\1/'))
112116 $(info downloading kubectl version $(KUBECTL_VERSION ) for $(ARCH ) )
117+ mkdir -p local-dev
113118 rm local-dev/kubectl || true
114- curl -sSLo local-dev/kubectl https://storage.googleapis.com/kubernetes-release /release/$(KUBECTL_VERSION ) /bin/$(ARCH ) /amd64/kubectl
119+ curl -sSLo local-dev/kubectl https://dl.k8s.io /release/$(KUBECTL_VERSION ) /bin/$(ARCH ) /amd64/kubectl
115120 chmod a+x local-dev/kubectl
116121endif
117122endif
@@ -131,24 +136,6 @@ helm/repos: local-dev/helm
131136
132137ARCH := $(shell uname | tr '[:upper:]' '[:lower:]')
133138
134- KIND = $(realpath ./local-dev/kind)
135- KIND_VERSION = v0.25.0
136-
137- .PHONY : local-dev/kind
138- local-dev/kind :
139- ifeq ($(KIND_VERSION ) , $(shell kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+) .*/\1/p'))
140- $(info linking local kind version $(KIND_VERSION))
141- ln -sf $(shell command -v kind) ./local-dev/kind
142- else
143- ifneq ($(KIND_VERSION ) , $(shell ./local-dev/kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+) .*/\1/p'))
144- $(info downloading kind version $(KIND_VERSION) for $(ARCH))
145- mkdir -p local-dev
146- rm local-dev/kind || true
147- curl -sSLo local-dev/kind https://kind.sigs.k8s.io/dl/$(KIND_VERSION)/kind-$(ARCH)-amd64
148- chmod a+x local-dev/kind
149- endif
150- endif
151-
152139# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
153140ifeq (,$(shell go env GOBIN) )
154141GOBIN =$(shell go env GOPATH) /bin
@@ -265,7 +252,7 @@ endif
265252
266253.PHONY : install-metallb
267254install-metallb :
268- LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK ) | $(JQ ) '. [0].IPAM.Config[0].Subnet ' | tr -d '"' ) && \
255+ LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK ) | $(JQ ) '.[].Containers[].IPv4Address ' | tr -d '"' ) && \
269256 export LAGOON_KIND_NETWORK_RANGE=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.' ) /29 && \
270257 $(HELM ) upgrade \
271258 --install \
@@ -374,11 +361,16 @@ install-lagoon-remote: install-registry
374361.PHONY : create-kind-cluster
375362create-kind-cluster : local-dev/tools helm/repos
376363 docker network inspect $(KIND_NETWORK ) > /dev/null || docker network create $(KIND_NETWORK ) \
377- && LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK ) | $(JQ ) '. [0].IPAM.Config[0].Subnet' | tr -d '"' ) \
378- && export KIND_NODE_IP=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.' ) \
379- && envsubst < test-resources/test-suite.kind-config.yaml.tpl > test-resources/test-suite.kind-config.yaml \
380364 && export KIND_EXPERIMENTAL_DOCKER_NETWORK=$(KIND_NETWORK ) \
381365 && $(KIND) create cluster --wait=60s --name=$(KIND_CLUSTER) --config=test-resources/test-suite.kind-config.yaml
366+ LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '.[].Containers[].IPv4Address' | tr -d '"') \
367+ && export KIND_NODE_IP=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.') \
368+ && envsubst < test-resources/test-suite.registry.toml.tpl > test-resources/test-suite.registry.toml \
369+ && export REGISTRY_DIR="/etc/containerd/certs.d/registry.$${KIND_NODE_IP}.nip.io" && \
370+ for node in $$($(KIND) get nodes --name $(KIND_CLUSTER)); do \
371+ docker exec "$$node" mkdir -p "$${REGISTRY_DIR}"; \
372+ cat test-resources/test-suite.registry.toml | docker exec -i "$$node" cp /dev/stdin "$${REGISTRY_DIR}/hosts.toml"; \
373+ done
382374
383375# generate-broker-certs will generate a ca, server and client certificate used for the test suite
384376.PHONY : generate-broker-certs
0 commit comments