Skip to content

Commit f215d14

Browse files
test
1 parent 5cde2a2 commit f215d14

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ tidy: #HELP Update dependencies.
117117
# Force tidy to use the version already in go.mod
118118
$(Q)go mod tidy -go=$(GOLANG_VERSION)
119119

120+
121+
.PHONY: install-controller-gen
122+
install-controller-gen: ## Install controller-gen with the required build tags
123+
go install -tags containers_image_openpgp sigs.k8s.io/controller-tools/cmd/controller-gen@latest
124+
120125
.PHONY: manifests
121126
KUSTOMIZE_CATD_CRDS_DIR := config/base/catalogd/crd/bases
122127
KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
@@ -128,19 +133,19 @@ CRD_WORKING_DIR := crd_work_dir
128133
# So we have to generate them together and then move them into place
129134
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
130135
mkdir $(CRD_WORKING_DIR)
131-
$(CONTROLLER_GEN) crd paths="./api/v1/..." output:crd:artifacts:config=$(CRD_WORKING_DIR)
136+
$(GOPATH)/bin/controller-gen crd paths="./api/v1/..." output:crd:artifacts:config=$(CRD_WORKING_DIR)
132137
mv $(CRD_WORKING_DIR)/olm.operatorframework.io_clusterextensions.yaml $(KUSTOMIZE_OPCON_CRDS_DIR)
133138
mv $(CRD_WORKING_DIR)/olm.operatorframework.io_clustercatalogs.yaml $(KUSTOMIZE_CATD_CRDS_DIR)
134139
rmdir $(CRD_WORKING_DIR)
135140
# Generate the remaining operator-controller manifests
136-
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
141+
$(GOPATH)/bin/controller-gen rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
137142
# Generate the remaining catalogd manifests
138-
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
139-
$(CONTROLLER_GEN) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
143+
$(GOPATH)/bin/controller-gen rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
144+
$(GOPATH)/bin/controller-gen webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)
140145

141146
.PHONY: generate
142147
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
143-
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
148+
$(GOPATH)/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
144149

145150
.PHONY: verify
146151
verify: tidy fmt generate manifests crd-ref-docs #HELP Verify all generated code is up-to-date.

0 commit comments

Comments
 (0)