Skip to content

Commit 2634dba

Browse files
author
Per Goncalves da Silva
committed
Split rbac generation into experimental/standard
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent e088ce9 commit 2634dba

21 files changed

+141
-31
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ KUSTOMIZE_OPCON_RBAC_DIR := config/base/operator-controller/rbac
149149
manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
150150
# Generate CRDs via our own generator
151151
hack/tools/update-crds.sh
152-
# Generate the remaining operator-controller manifests
153-
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)
152+
# Generate the remaining operator-controller standard manifests
153+
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS),standard rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)/standard
154+
# Generate the remaining operator-controller experimental manifests
155+
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/operator-controller/..." output:rbac:artifacts:config=$(KUSTOMIZE_OPCON_RBAC_DIR)/experimental
154156
# Generate the remaining catalogd manifests
155157
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) rbac:roleName=manager-role paths="./internal/catalogd/..." output:rbac:artifacts:config=$(KUSTOMIZE_CATD_RBAC_DIR)
156158
$(CONTROLLER_GEN) --load-build-tags=$(GO_BUILD_TAGS) webhook paths="./internal/catalogd/..." output:webhook:artifacts:config=$(KUSTOMIZE_CATD_WEBHOOKS_DIR)

config/base/operator-controller/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ kind: Kustomization
44
namespace: olmv1-system
55
namePrefix: operator-controller-
66
resources:
7-
- rbac
87
- manager

config/base/operator-controller/manager/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
3-
43
resources:
54
- manager.yaml
65
- service.yaml

config/base/operator-controller/rbac/auth_proxy_client_clusterrole.yaml renamed to config/base/operator-controller/rbac/common/auth_proxy_client_clusterrole.yaml

File renamed without changes.

config/base/operator-controller/rbac/auth_proxy_role.yaml renamed to config/base/operator-controller/rbac/common/auth_proxy_role.yaml

File renamed without changes.

config/base/operator-controller/rbac/auth_proxy_role_binding.yaml renamed to config/base/operator-controller/rbac/common/auth_proxy_role_binding.yaml

File renamed without changes.

config/base/operator-controller/rbac/clusterextension_editor_role.yaml renamed to config/base/operator-controller/rbac/common/clusterextension_editor_role.yaml

File renamed without changes.

config/base/operator-controller/rbac/clusterextension_viewer_role.yaml renamed to config/base/operator-controller/rbac/common/clusterextension_viewer_role.yaml

File renamed without changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
resources:
2+
# All RBAC will be applied under this service account in
3+
# the deployment namespace. You may comment out this resource
4+
# if your manager will use a service account that exists at
5+
# runtime. Be sure to update RoleBinding and ClusterRoleBinding
6+
# subjects if changing service account names.
7+
- service_account.yaml
8+
- role_binding.yaml
9+
- leader_election_role.yaml
10+
- leader_election_role_binding.yaml
11+
12+
# The following resources are pre-defined roles for editors and viewers
13+
# of APIs provided by this project.
14+
- clusterextension_editor_role.yaml
15+
- clusterextension_viewer_role.yaml
16+
17+
# The following RBAC configurations are used to protect
18+
# the metrics endpoint with authn/authz. These configurations
19+
# ensure that only authorized users and service accounts
20+
# can access the metrics endpoint. Comment the following
21+
# permissions if you want to disable this protection.
22+
# More info: https://book.kubebuilder.io/reference/metrics.html
23+
- auth_proxy_role.yaml
24+
- auth_proxy_role_binding.yaml
25+
- auth_proxy_client_clusterrole.yaml
26+

config/base/operator-controller/rbac/leader_election_role.yaml renamed to config/base/operator-controller/rbac/common/leader_election_role.yaml

File renamed without changes.

0 commit comments

Comments
 (0)