@@ -118,14 +118,20 @@ KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
118118KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/manager/webhook
119119KUSTOMIZE_OPCON_CRDS_DIR := config/base/operator-controller/crd/bases
120120KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
121+ CRD_WORKING_DIR := crd_work_dir
122+ # Due to https://github.com/kubernetes-sigs/controller-tools/issues/837 we can't specify individual files
123+ # So we have to generate them together and then move them into place
121124manifests : $(CONTROLLER_GEN ) # EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
122- # Generate the operator-controller manifests
123- rm -rf $(KUSTOMIZE_OPCON_CRDS_DIR ) && $(CONTROLLER_GEN ) crd paths=./api/operator-controller/... output:crd:artifacts:config=$(KUSTOMIZE_OPCON_CRDS_DIR )
124- rm -f $(KUSTOMIZE_OPCON_RBAC_DIR ) /role.yaml && $(CONTROLLER_GEN ) rbac:roleName=manager-role paths=./internal/operator-controller/... output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR )
125- # Generate the catalogd manifests
126- rm -rf $(KUSTOMIZE_CATD_CRDS_DIR ) && $(CONTROLLER_GEN ) crd paths=./api/catalogd/... output:crd:artifacts:config=$(KUSTOMIZE_CATD_CRDS_DIR )
127- rm -f $(KUSTOMIZE_CATD_RBAC_DIR ) /role.yaml && $(CONTROLLER_GEN ) rbac:roleName=manager-role paths=" ./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR )
128- rm -f $(KUSTOMIZE_CATD_WEBHOOKS_DIR ) /manifests.yaml && $(CONTROLLER_GEN ) webhook paths=" ./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR )
125+ mkdir $(CRD_WORKING_DIR )
126+ $(CONTROLLER_GEN ) crd paths=" ./api/v1/..." output:crd:artifacts:config=$(CRD_WORKING_DIR )
127+ mv $(CRD_WORKING_DIR ) /olm.operatorframework.io_clusterextensions.yaml $(KUSTOMIZE_OPCON_CRDS_DIR )
128+ mv $(CRD_WORKING_DIR ) /olm.operatorframework.io_clustercatalogs.yaml $(KUSTOMIZE_CATD_CRDS_DIR )
129+ rmdir $(CRD_WORKING_DIR )
130+ # Generate the remaining operator-controller manifests
131+ $(CONTROLLER_GEN ) rbac:roleName=manager-role paths=" ./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR )
132+ # Generate the remaining catalogd manifests
133+ $(CONTROLLER_GEN ) rbac:roleName=manager-role paths=" ./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR )
134+ $(CONTROLLER_GEN ) webhook paths=" ./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR )
129135
130136.PHONY : generate
131137generate : $(CONTROLLER_GEN ) # EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -353,20 +359,13 @@ quickstart: $(KUSTOMIZE) manifests #EXHELP Generate the unified installation rel
353359
354360.PHONY : crd-ref-docs
355361OPERATOR_CONTROLLER_API_REFERENCE_FILENAME := operator-controller-api-reference.md
356- CATALOGD_API_REFERENCE_FILENAME := catalogd-api-reference.md
357362API_REFERENCE_DIR := $(ROOT_DIR ) /docs/api-reference
358-
359363crd-ref-docs : $(CRD_REF_DOCS ) # EXHELP Generate the API Reference Documents.
360364 rm -f $(API_REFERENCE_DIR ) /$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME )
361- $(CRD_REF_DOCS ) --source-path=$(ROOT_DIR ) /api/operator-controller \
365+ $(CRD_REF_DOCS ) --source-path=$(ROOT_DIR ) /api/ \
362366 --config=$(API_REFERENCE_DIR ) /crd-ref-docs-gen-config.yaml \
363367 --renderer=markdown --output-path=$(API_REFERENCE_DIR ) /$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME ) ;
364368
365- rm -f $(API_REFERENCE_DIR)/$(CATALOGD_API_REFERENCE_FILENAME)
366- $(CRD_REF_DOCS) --source-path=$(ROOT_DIR)/api/catalogd \
367- --config=$(API_REFERENCE_DIR)/crd-ref-docs-gen-config.yaml \
368- --renderer=markdown --output-path=$(API_REFERENCE_DIR)/$(CATALOGD_API_REFERENCE_FILENAME);
369-
370369VENVDIR := $(abspath docs/.venv)
371370
372371.PHONY : build-docs
0 commit comments