Skip to content

Commit 834d41f

Browse files
CSPL-3964: Adding envtest target for pipeline to properly install envtest binary in context.
1 parent 8967818 commit 834d41f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,15 @@ $(KUSTOMIZE): $(LOCALBIN)
232232

233233
ENVTEST ?= $(LOCALBIN)/setup-envtest
234234
.PHONY: setup-envtest
235-
setup-envtest:
235+
setup-envtest: envtest
236236
@$(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path || { \
237237
echo "Error setting up envtest"; exit 1; }
238238

239+
.PHONY: envtest
240+
envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
241+
$(ENVTEST): $(LOCALBIN)
242+
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
243+
239244
## Generate bundle manifests and metadata, then validate generated files.
240245
## In addition, copy the newly generated crd files to helm crds.
241246
.PHONY: bundle

0 commit comments

Comments
 (0)