Skip to content

Commit d360f01

Browse files
author
Mengqi Yu
committed
🐛 end users should not have permissions to edit */status
1 parent 74f69d6 commit d360f01

File tree

8 files changed

+8
-16
lines changed

8 files changed

+8
-16
lines changed

pkg/scaffold/v2/crd_editor_rbac.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (g *CRDEditorRole) Validate() error {
5050
return g.Resource.Validate()
5151
}
5252

53-
const crdRoleEditorTemplate = `# permissions to do edit {{ .Resource.Resource }}.
53+
const crdRoleEditorTemplate = `# permissions for end users to edit {{ .Resource.Resource }}.
5454
apiVersion: rbac.authorization.k8s.io/v1
5555
kind: ClusterRole
5656
metadata:
@@ -74,6 +74,4 @@ rules:
7474
- {{ .Resource.Resource }}/status
7575
verbs:
7676
- get
77-
- patch
78-
- update
7977
`

pkg/scaffold/v2/crd_viewer_rbac.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (g *CRDViewerRole) Validate() error {
5050
return g.Resource.Validate()
5151
}
5252

53-
const crdRoleViewerTemplate = `# permissions to do viewer {{ .Resource.Resource }}.
53+
const crdRoleViewerTemplate = `# permissions for end users to view {{ .Resource.Resource }}.
5454
apiVersion: rbac.authorization.k8s.io/v1
5555
kind: ClusterRole
5656
metadata:

testdata/project-v2/config/rbac/admiral_editor_role.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# permissions to do edit admirals.
1+
# permissions for end users to edit admirals.
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
@@ -22,5 +22,3 @@ rules:
2222
- admirals/status
2323
verbs:
2424
- get
25-
- patch
26-
- update

testdata/project-v2/config/rbac/admiral_viewer_role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# permissions to do viewer admirals.
1+
# permissions for end users to view admirals.
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:

testdata/project-v2/config/rbac/captain_editor_role.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# permissions to do edit captains.
1+
# permissions for end users to edit captains.
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
@@ -22,5 +22,3 @@ rules:
2222
- captains/status
2323
verbs:
2424
- get
25-
- patch
26-
- update

testdata/project-v2/config/rbac/captain_viewer_role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# permissions to do viewer captains.
1+
# permissions for end users to view captains.
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:

testdata/project-v2/config/rbac/firstmate_editor_role.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# permissions to do edit firstmates.
1+
# permissions for end users to edit firstmates.
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
@@ -22,5 +22,3 @@ rules:
2222
- firstmates/status
2323
verbs:
2424
- get
25-
- patch
26-
- update

testdata/project-v2/config/rbac/firstmate_viewer_role.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# permissions to do viewer firstmates.
1+
# permissions for end users to view firstmates.
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:

0 commit comments

Comments
 (0)