Skip to content

Commit 26970ef

Browse files
Allow add of labels to clusterrole (#669)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it It addresses issue [518](open-component-model/ocm-project#518) #### Which issue(s) this PR fixes resolves [518](open-component-model/ocm-project#518) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent b4aabb6 commit 26970ef

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ help: ## Display this help.
6262

6363
##@ Development
6464

65-
.PHONY: manifests
66-
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
67-
$(CONTROLLER_GEN) rbac:roleName=ocm-controller-manager-role crd webhook paths="./api/..." paths="./controllers/..." output:crd:artifacts:config=deploy/crds output:rbac:artifacts:config=deploy/templates
65+
.PHONY: manifests
66+
67+
## 2025-06-10 : Removed RBAC gen from manifest target. See https://github.com/open-component-model/ocm-project/issues/518
68+
manifests: controller-gen ## Generate WebhookConfiguration and CustomResourceDefinition objects.
69+
$(CONTROLLER_GEN) crd webhook paths="./api/..." paths="./controllers/..." output:crd:artifacts:config=deploy/crds
70+
6871

6972
.PHONY: generate
7073
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.

deploy/templates/role.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
{{/*
2+
2025-06-10 :
3+
Switched from generating this with controller-gen to maintaining it by hand.
4+
See https://github.com/open-component-model/ocm-project/issues/518
5+
*/ -}}
16
---
27
apiVersion: rbac.authorization.k8s.io/v1
38
kind: ClusterRole
49
metadata:
510
name: ocm-controller-manager-role
11+
labels: {{ $.Values.manager.clusterRole.labels | toJson }}
612
rules:
713
- apiGroups:
814
- ""

deploy/templates/role_binding.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
{{/*
2+
2025-06-10 :
3+
Switched from generating this with controller-gen to maintaining it by hand.
4+
See https://github.com/open-component-model/ocm-project/issues/518
5+
*/ -}}
16
apiVersion: rbac.authorization.k8s.io/v1
27
kind: ClusterRoleBinding
38
metadata:

deploy/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ manager:
5959
nodeSelector: {}
6060
tolerations: []
6161
affinity: {}
62+
clusterRole:
63+
labels:
6264

6365
monitoring:
6466
enabled: false

0 commit comments

Comments
 (0)