mirror of
https://github.com/coredns/coredns.git
synced 2025-12-02 00:24:08 -05:00
26 lines
600 B
Makefile
26 lines
600 B
Makefile
|
|
.PHONY: generate
|
||
|
|
generate: controller-gen
|
||
|
|
$(CONTROLLER_GEN) \
|
||
|
|
object \
|
||
|
|
paths="./apis/..."
|
||
|
|
$(CONTROLLER_GEN) \
|
||
|
|
crd \
|
||
|
|
paths="./apis/..." \
|
||
|
|
output:crd:artifacts:config=manifests/crds/
|
||
|
|
|
||
|
|
.PHONY: controller-gen
|
||
|
|
controller-gen:
|
||
|
|
ifeq (, $(shell which controller-gen))
|
||
|
|
@{ \
|
||
|
|
set -e ;\
|
||
|
|
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
|
||
|
|
cd $$CONTROLLER_GEN_TMP_DIR ;\
|
||
|
|
go mod init tmp ;\
|
||
|
|
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\
|
||
|
|
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
|
||
|
|
}
|
||
|
|
CONTROLLER_GEN=$(shell go env GOPATH)/bin/controller-gen
|
||
|
|
else
|
||
|
|
CONTROLLER_GEN=$(shell which controller-gen)
|
||
|
|
endif
|