Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit c54d624

Browse files
committed
Add KCP APIs to scheme, enforce kind image version
While testing out the `controller-runtime-example` Makefile, specifically running `make test-e2e` I noticed that the build was failing locally and the controller pod was crashing. After a bit of debugging, it seems that the scheme was missing KCP's APIExport Kind, which caused the `error looking up virtual workspace URL` error, and then the panic for the controller. In addition, this PR enforces a known working version of Kubernetes when testing locally, and it fixes an issue on Mac where the ~ sign (i.e. HOME) wasn't working properly. Signed-off-by: Vince Prignano <vince@prigna.com>
1 parent 1db5ec2 commit c54d624

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ kind-image: docker-build ## Load the controller-manager image into the kind clus
142142
kind load docker-image $(REGISTRY)/$(IMG) --name controller-runtime-example
143143

144144
$(ARTIFACT_DIR)/kind.kubeconfig: $(ARTIFACT_DIR) ## Run a kind cluster and generate a $KUBECONFIG for it.
145-
@if ! kind get clusters --quiet | grep --quiet controller-runtime-example; then kind create cluster --name controller-runtime-example; fi
145+
@if ! kind get clusters --quiet | grep --quiet controller-runtime-example; then kind create cluster --name controller-runtime-example --image kindest/node:v1.24.2; fi
146146
kind get kubeconfig --name controller-runtime-example > $(ARTIFACT_DIR)/kind.kubeconfig
147147

148148
$(ARTIFACT_DIR): ## Create a directory for test artifacts.
@@ -211,7 +211,7 @@ ifndef ignore-not-found
211211
ignore-not-found = false
212212
endif
213213

214-
KUBECONFIG ?= $(abspath ~/.kube/config )
214+
KUBECONFIG ?= $(abspath ${HOME}/.kube/config )
215215

216216
.PHONY: install
217217
install: manifests $(KUSTOMIZE) ## Install APIResourceSchemas and APIExport into kcp (using $KUBECONFIG or ~/.kube/config).

main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ var (
6161

6262
func init() {
6363
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
64+
utilruntime.Must(apisv1alpha1.AddToScheme(scheme))
6465
utilruntime.Must(datav1alpha1.AddToScheme(scheme))
6566
// +kubebuilder:scaffold:scheme
6667

0 commit comments

Comments
 (0)