@@ -117,6 +117,20 @@ 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+ # 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 \
127+ libgmp-dev libgpgme-dev libassuan-dev \
128+ pkg-config; \
129+ elif [ " $( shell uname -s) " = " Darwin" ]; then \
130+ echo " Installing dependencies on macOS..." ; \
131+ brew install gmp gpgme; \
132+ fi
133+
120134.PHONY : manifests
121135KUSTOMIZE_CATD_CRDS_DIR := config/base/catalogd/crd/bases
122136KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
@@ -126,7 +140,7 @@ KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
126140CRD_WORKING_DIR := crd_work_dir
127141# Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
128142# So we have to generate them together and then move them into place
129- manifests : $(CONTROLLER_GEN ) # EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
143+ manifests : setup-cgc-local-deps $(CONTROLLER_GEN ) # EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
130144 mkdir $(CRD_WORKING_DIR )
131145 $(CONTROLLER_GEN ) crd paths=" ./api/v1/..." output:crd:artifacts:config=$(CRD_WORKING_DIR )
132146 mv $(CRD_WORKING_DIR ) /olm.operatorframework.io_clusterextensions.yaml $(KUSTOMIZE_OPCON_CRDS_DIR )
@@ -139,7 +153,7 @@ manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole,
139153 $(CONTROLLER_GEN ) webhook paths=" ./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR )
140154
141155.PHONY : generate
142- generate : $(CONTROLLER_GEN ) # EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
156+ generate : setup-cgc-local-deps $(CONTROLLER_GEN ) # EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
143157 $(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
144158
145159.PHONY : verify
0 commit comments