@@ -117,6 +117,18 @@ tidy: #HELP Update dependencies.
117
117
# Force tidy to use the version already in go.mod
118
118
$(Q ) go mod tidy -go=$(GOLANG_VERSION )
119
119
120
+ # Controller-gen does not support build tags
121
+ # After we upgrade github.com/containers/image/v5 from v5.33.1 start to be required to those installed
122
+ .PHONY : setup-cgc-local-deps
123
+ setup-cgc-local-deps : # EXHELP Install required system dependencies for controller-gen
124
+ @if [ " $( shell uname -s) " = " Linux" ]; then \
125
+ echo " Installing dependencies on Linux..." ; \
126
+ sudo apt update && sudo apt install -y libgmp-dev libgpgme-dev; \
127
+ elif [ " $( shell uname -s) " = " Darwin" ]; then \
128
+ echo " Installing dependencies on macOS..." ; \
129
+ brew install gmp gpgme; \
130
+ fi
131
+
120
132
.PHONY : manifests
121
133
KUSTOMIZE_CATD_CRDS_DIR := config/base/catalogd/crd/bases
122
134
KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
@@ -126,7 +138,7 @@ KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
126
138
CRD_WORKING_DIR := crd_work_dir
127
139
# Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
128
140
# So we have to generate them together and then move them into place
129
- manifests : $(CONTROLLER_GEN ) # EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
141
+ manifests : setup-cgc-local-deps $(CONTROLLER_GEN ) # EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
130
142
mkdir $(CRD_WORKING_DIR )
131
143
$(CONTROLLER_GEN ) crd paths=" ./api/v1/..." output:crd:artifacts:config=$(CRD_WORKING_DIR )
132
144
mv $(CRD_WORKING_DIR ) /olm.operatorframework.io_clusterextensions.yaml $(KUSTOMIZE_OPCON_CRDS_DIR )
@@ -139,7 +151,7 @@ manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole,
139
151
$(CONTROLLER_GEN ) webhook paths=" ./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR )
140
152
141
153
.PHONY : generate
142
- generate : $(CONTROLLER_GEN ) # EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
154
+ generate : setup-cgc-local-deps $(CONTROLLER_GEN ) # EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
143
155
$(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
144
156
145
157
.PHONY : verify
0 commit comments