Skip to content

Commit

Permalink
Test: Relax rbac roles for all resources
Browse files Browse the repository at this point in the history
  • Loading branch information
furkatgofurov7 committed Nov 29, 2023
1 parent 23960d9 commit 81d7bcc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
2 changes: 2 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ func InitFlags(fs *pflag.FlagSet) {
flags.AddDiagnosticsOptions(fs, &diagnosticsOptions)
}

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

func main() {
InitFlags(pflag.CommandLine)
Expand Down
24 changes: 15 additions & 9 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ metadata:
name: manager-role
rules:
- apiGroups:
- authentication.k8s.io
- '*'
resources:
- tokenreviews
- '*'
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
- '*'
# - apiGroups:
# - authentication.k8s.io
# resources:
# - tokenreviews
# verbs:
# - create
# - apiGroups:
# - authorization.k8s.io
# resources:
# - subjectaccessreviews
# verbs:
# - create
5 changes: 5 additions & 0 deletions go.test.work
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
go 1.19

use (
./
)
12 changes: 3 additions & 9 deletions test/e2e/resources/full-chart-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13952,17 +13952,11 @@ metadata:
name: capi-operator-manager-role
rules:
- apiGroups:
- authentication.k8s.io
- '*'
resources:
- tokenreviews
- '*'
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
- '*'
---
# Source: cluster-api-operator/templates/operator-components.yaml
apiVersion: rbac.authorization.k8s.io/v1
Expand Down

0 comments on commit 81d7bcc

Please sign in to comment.