Skip to content

Commit 2e45b55

Browse files
Edit controller-gen call to only generate manifests for operrator-controller and exclude catalogd
1 parent 307a288 commit 2e45b55

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,12 @@ tidy: #HELP Update dependencies.
100100
$(Q)go mod tidy -go=$(GOLANG_VERSION)
101101

102102
.PHONY: manifests
103-
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
104-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/base/crd/bases output:rbac:artifacts:config=config/base/rbac
103+
# To exclude catalogd. Otherwise, the CRD, Webhook and other configurations will be generated and added to the config/
104+
PATHS = ./api/... ./cmd/... ./internal/... ./test/...
105+
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
106+
@for path in $(PATHS); do \
107+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="$$path" output:crd:artifacts:config=config/base/crd/bases output:rbac:artifacts:config=config/base/rbac; \
108+
done
105109

106110
.PHONY: generate
107111
generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

config/base/rbac/role.yaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,25 @@ rules:
2121
resources:
2222
- clustercatalogs
2323
verbs:
24-
- create
25-
- delete
2624
- get
2725
- list
28-
- patch
29-
- update
3026
- watch
3127
- apiGroups:
3228
- olm.operatorframework.io
3329
resources:
34-
- clustercatalogs/finalizers
35-
- clusterextensions/finalizers
36-
verbs:
37-
- update
38-
- apiGroups:
39-
- olm.operatorframework.io
40-
resources:
41-
- clustercatalogs/status
30+
- clusterextensions
4231
verbs:
4332
- get
33+
- list
4434
- patch
4535
- update
36+
- watch
4637
- apiGroups:
4738
- olm.operatorframework.io
4839
resources:
49-
- clusterextensions
40+
- clusterextensions/finalizers
5041
verbs:
51-
- get
52-
- list
53-
- patch
5442
- update
55-
- watch
5643
- apiGroups:
5744
- olm.operatorframework.io
5845
resources:

0 commit comments

Comments
 (0)