Skip to content

Commit 81d7bcc

Browse files
Test: Relax rbac roles for all resources
1 parent 23960d9 commit 81d7bcc

File tree

4 files changed

+25
-18
lines changed

4 files changed

+25
-18
lines changed

cmd/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ func InitFlags(fs *pflag.FlagSet) {
124124
flags.AddDiagnosticsOptions(fs, &diagnosticsOptions)
125125
}
126126

127+
/*
127128
// Add RBAC for the authorized diagnostics endpoint.
128129
// +kubebuilder:rbac:groups=authentication.k8s.io,resources=tokenreviews,verbs=create
129130
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create
131+
*/
130132

131133
func main() {
132134
InitFlags(pflag.CommandLine)

config/rbac/role.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ metadata:
55
name: manager-role
66
rules:
77
- apiGroups:
8-
- authentication.k8s.io
8+
- '*'
99
resources:
10-
- tokenreviews
10+
- '*'
1111
verbs:
12-
- create
13-
- apiGroups:
14-
- authorization.k8s.io
15-
resources:
16-
- subjectaccessreviews
17-
verbs:
18-
- create
12+
- '*'
13+
# - apiGroups:
14+
# - authentication.k8s.io
15+
# resources:
16+
# - tokenreviews
17+
# verbs:
18+
# - create
19+
# - apiGroups:
20+
# - authorization.k8s.io
21+
# resources:
22+
# - subjectaccessreviews
23+
# verbs:
24+
# - create

go.test.work

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
go 1.19
2+
3+
use (
4+
./
5+
)

test/e2e/resources/full-chart-install.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13952,17 +13952,11 @@ metadata:
1395213952
name: capi-operator-manager-role
1395313953
rules:
1395413954
- apiGroups:
13955-
- authentication.k8s.io
13955+
- '*'
1395613956
resources:
13957-
- tokenreviews
13957+
- '*'
1395813958
verbs:
13959-
- create
13960-
- apiGroups:
13961-
- authorization.k8s.io
13962-
resources:
13963-
- subjectaccessreviews
13964-
verbs:
13965-
- create
13959+
- '*'
1396613960
---
1396713961
# Source: cluster-api-operator/templates/operator-components.yaml
1396813962
apiVersion: rbac.authorization.k8s.io/v1

0 commit comments

Comments
 (0)