@@ -118,14 +118,20 @@ KUSTOMIZE_CATD_RBAC_DIR := config/base/catalogd/rbac
118
118
KUSTOMIZE_CATD_WEBHOOKS_DIR := config/base/catalogd/manager/webhook
119
119
KUSTOMIZE_OPCON_CRDS_DIR := config/base/operator-controller/crd/bases
120
120
KUSTOMIZE_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
121
124
manifests : $(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 )
129
135
130
136
.PHONY : generate
131
137
generate : $(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
353
359
354
360
.PHONY : crd-ref-docs
355
361
OPERATOR_CONTROLLER_API_REFERENCE_FILENAME := operator-controller-api-reference.md
356
- CATALOGD_API_REFERENCE_FILENAME := catalogd-api-reference.md
357
362
API_REFERENCE_DIR := $(ROOT_DIR ) /docs/api-reference
358
-
359
363
crd-ref-docs : $(CRD_REF_DOCS ) # EXHELP Generate the API Reference Documents.
360
364
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/ \
362
366
--config=$(API_REFERENCE_DIR ) /crd-ref-docs-gen-config.yaml \
363
367
--renderer=markdown --output-path=$(API_REFERENCE_DIR ) /$(OPERATOR_CONTROLLER_API_REFERENCE_FILENAME ) ;
364
368
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
-
370
369
VENVDIR := $(abspath docs/.venv)
371
370
372
371
.PHONY : build-docs
0 commit comments