File tree Expand file tree Collapse file tree 5 files changed +56
-49
lines changed Expand file tree Collapse file tree 5 files changed +56
-49
lines changed Original file line number Diff line number Diff line change 21
21
.idea/
22
22
*.tmproj
23
23
.vscode/
24
+ # helper scripts
25
+ helmify.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # This script is used to tweak manifests generated by controller-gen to make them
4
+ # compatible with the rest of the chart.
5
+ #
6
+ # It is not intended to be run directly, but is invoked when running `go generate ./...`
7
+
8
+ here=$( realpath " $( dirname " $0 " ) " )
9
+
10
+ # this mv is a hack; it will no longer be necessary once controller-gen supports
11
+ # specifying the filename; see https://github.com/kubernetes-sigs/controller-tools/pull/1169
12
+ mv " $here " /templates/role.yaml " $here " /templates/controller.static.rbac.yaml
13
+ printf " %s\n%s\n%s\n" \
14
+ ' {{- if eq .Values.rbac.mode "aggregation" }}' \
15
+ " $( sed -E " s/name: kro:(.*)/name: '{{ include \" kro.fullname\" . }}:\1'/" " $here " /templates/controller.static.rbac.yaml) " \
16
+ ' {{- end }}' > temp && mv temp " $here " /templates/controller.static.rbac.yaml
Original file line number Diff line number Diff line change @@ -31,53 +31,4 @@ aggregationRule:
31
31
clusterRoleSelectors:
32
32
- matchLabels:
33
33
'rbac.kro.run/aggregate-to-controller': "true"
34
- ---
35
- apiVersion: rbac.authorization.k8s.io/v1
36
- kind: ClusterRole
37
- metadata:
38
- annotations:
39
- kubernetes.io/description: |
40
- This ClusterRole grants access for the kro controller to resources it always needs access to.
41
- labels:
42
- {{- include "kro.labels" . | nindent 4 }}
43
- rbac.kro.run/aggregate-to-controller: "true"
44
- name: {{ include "kro.fullname" . }}:controller:static
45
- rules:
46
- - apiGroups:
47
- - kro.run
48
- resources:
49
- - resourcegraphdefinitions
50
- verbs:
51
- - create
52
- - delete
53
- - get
54
- - list
55
- - patch
56
- - update
57
- - watch
58
- - apiGroups:
59
- - kro.run
60
- resources:
61
- - resourcegraphdefinitions/finalizers
62
- verbs:
63
- - update
64
- - apiGroups:
65
- - kro.run
66
- resources:
67
- - resourcegraphdefinitions/status
68
- verbs:
69
- - get
70
- - patch
71
- - update
72
- - apiGroups:
73
- - apiextensions.k8s.io
74
- resources:
75
- - customresourcedefinitions
76
- verbs:
77
- - get
78
- - list
79
- - watch
80
- - patch
81
- - update
82
- - delete
83
34
{{- end }}
Original file line number Diff line number Diff line change
1
+ {{- if eq .Values.rbac.mode "aggregation" }}
2
+ ---
3
+ apiVersion : rbac.authorization.k8s.io/v1
4
+ kind : ClusterRole
5
+ metadata :
6
+ name : ' {{ include "kro.fullname" . }}:controller:static'
7
+ rules :
8
+ - apiGroups :
9
+ - kro.run
10
+ resources :
11
+ - resourcegraphdefinitions
12
+ verbs :
13
+ - create
14
+ - delete
15
+ - get
16
+ - list
17
+ - patch
18
+ - update
19
+ - watch
20
+ - apiGroups :
21
+ - kro.run
22
+ resources :
23
+ - resourcegraphdefinitions/finalizers
24
+ verbs :
25
+ - update
26
+ - apiGroups :
27
+ - kro.run
28
+ resources :
29
+ - resourcegraphdefinitions/status
30
+ verbs :
31
+ - get
32
+ - patch
33
+ - update
34
+ {{- end }}
Original file line number Diff line number Diff line change
1
+ package pkg
2
+
3
+ //go:generate go tool controller-gen rbac:roleName="kro:controller:static" crd paths="../..." output:crd:artifacts:config=../helm/crds output:rbac:artifacts:config=../helm/templates
4
+ //go:generate ../helm/helmify.sh
You can’t perform that action at this time.
0 commit comments