File tree 3 files changed +37
-0
lines changed
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## Introduction
2
+
3
+ ` add-rolebinding ` is a KCL mutation module.
4
+
5
+ ## Resource
6
+
7
+ The Code source and documents are [ here] ( https://github.com/kcl-lang/artifacthub/tree/main/add-rolebinding )
Original file line number Diff line number Diff line change
1
+ [package]
2
+ name = " add-rolebinding"
3
+ version = " 0.1.0"
4
+ description = " `add-rolebinding` is a KCL mutation module."
5
+
Original file line number Diff line number Diff line change
1
+ ns_list = [item.metadata.name for item in option("items") if item.kind == "Namespace"]
2
+ username = option("params")?.username or "user"
3
+
4
+ items = option("items") + [
5
+ {
6
+ synchronize: True
7
+ apiVersion: "rbac.authorization.k8s.io/v1"
8
+ kind: "RoleBinding"
9
+ name: "${username}-admin-binding"
10
+ namespace: ns.metadata.name
11
+ data: {
12
+ roleRef: {
13
+ apiGroup: "rbac.authorization.k8s.io"
14
+ kind: "ClusterRole"
15
+ name: "admin"
16
+ }
17
+ subjects: [
18
+ {
19
+ kind: "User"
20
+ name: "${username}"
21
+ }
22
+ ]
23
+ }
24
+ } for ns in ns_list
25
+ ]
You can’t perform that action at this time.
0 commit comments