@@ -22,7 +22,7 @@ help: ## Display this help.
2222
2323.PHONY : manifests
2424manifests : controller-gen # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
25- $(CONTROLLER_GEN ) rbac:roleName=imageprefetch-controller-role crd webhook paths=" ./..." output:crd:artifacts:config=config/crd/bases
25+ $(CONTROLLER_GEN ) rbac:roleName=imageprefetch-controller-role crd paths=" ./..." output:crd:artifacts:config=config/crd/bases
2626
2727.PHONY : generate
2828generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -58,8 +58,9 @@ vet: ## Run go vet against code.
5858 go vet ./...
5959
6060.PHONY : test
61- test : manifests generate fmt vet envtest ginkgo # # Run tests.
61+ test : manifests generate fmt vet envtest ginkgo kaptest # # Run tests.
6262 KUBEBUILDER_ASSETS=" $( shell $( ENVTEST) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " $(GINKGO ) run --skip-file e2e.* -r --coverprofile cover.out -v
63+ $(KAPTEST ) run config/vap/vap.test/kaptest.yaml
6364
6465# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
6566.PHONY : test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
@@ -136,6 +137,7 @@ GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
136137GINKGO = $(LOCALBIN ) /ginkgo
137138APPLYCONFIGURATION_GEN = $(LOCALBIN ) /applyconfiguration-gen
138139MODELS_SCHEMA = $(LOCALBIN ) /models-schema
140+ KAPTEST ?= $(LOCALBIN ) /kaptest
139141
140142# # Tool Versions
141143KUSTOMIZE_VERSION ?= v5.6.0
@@ -145,6 +147,7 @@ GOLANGCI_LINT_VERSION ?= v2.1.6
145147GINKGO_VERSION ?= v2.23.4
146148CODE_GENERATOR_VERSION ?= v0.31.1
147149MODELS_SCHEMA_VERSION ?= v1.31.1
150+ KAPTEST_VERSION ?= v0.1.2
148151
149152.PHONY : kustomize
150153kustomize : $(KUSTOMIZE ) # # Download kustomize locally if necessary.
@@ -186,6 +189,13 @@ applyconfiguration-gen: $(APPLYCONFIGURATION_GEN) ## Download applyconfiguration
186189$(APPLYCONFIGURATION_GEN ) : $(LOCALBIN )
187190 $(call go-install-tool,$(APPLYCONFIGURATION_GEN ) ,k8s.io/code-generator/cmd/applyconfiguration-gen,$(CODE_GENERATOR_VERSION ) )
188191
192+ .PHONY : kaptest
193+ kaptest : $(KAPTEST ) # # Download kaptest locally if necessary.
194+ $(KAPTEST ) : $(LOCALBIN )
195+ curl -sLO " https://github.com/pfnet/kaptest/releases/download/${KAPTEST_VERSION} /kaptest_Linux_x86_64.tar.gz" && \
196+ tar -xzf kaptest_Linux_x86_64.tar.gz -C $(LOCALBIN ) kaptest && \
197+ rm -f kaptest_Linux_x86_64.tar.gz
198+
189199# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
190200# $1 - target path with name of binary
191201# $2 - package url which can be installed
0 commit comments