-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile.reconcilermanager
34 lines (29 loc) · 1.3 KB
/
Makefile.reconcilermanager
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CONTROLLER_GEN := $(GOBIN)/controller-gen
.PHONY: generate
# Generate DeepCopy and runtime.Object implementation methods.
generate: install-controller-gen
$(CONTROLLER_GEN) \
object:headerFile="hack/boilerplate.txt" \
paths="./pkg/api/configsync/v1alpha1" \
paths="./pkg/api/configsync/v1beta1" \
paths="./pkg/api/configmanagement/v1"
.PHONY: configsync-crds
# Generate configsync CRDs
configsync-crds: install-controller-gen "$(GOBIN)/kustomize" "$(GOBIN)/addlicense"
$(CONTROLLER_GEN) \
crd \
paths="./pkg/api/configsync/v1alpha1" \
paths="./pkg/api/configsync/v1beta1" \
output:artifacts:config=manifests \
&& mv manifests/configsync.gke.io_reposyncs.yaml manifests/patch/reposync-crd.yaml \
&& mv manifests/configsync.gke.io_rootsyncs.yaml manifests/patch/rootsync-crd.yaml; \
"$(GOBIN)/kustomize" build ./manifests/patch -o ./manifests; \
mv ./manifests/*customresourcedefinition_rootsyncs* ./manifests/rootsync-crd.yaml; \
mv ./manifests/*customresourcedefinition_reposyncs* ./manifests/reposync-crd.yaml; \
rm ./manifests/patch/reposync-crd.yaml; \
rm ./manifests/patch/rootsync-crd.yaml; \
"$(GOBIN)/addlicense" ./manifests; \
.PHONY: install-controller-gen
# install controller-gen from source
install-controller-gen:
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.0