Skip to content

Commit

Permalink
Allow kubevirt:view role to get,list kubevirts
Browse files Browse the repository at this point in the history
Kubevirt resource is in category all.
`kubectl get all` or `virtctl permitted-devices` fails if
the user don't have the permissions to list Kubevirt resource.

Signed-off-by: fossedihelm <[email protected]>
  • Loading branch information
fossedihelm committed Nov 22, 2023
1 parent f920d48 commit 38ba821
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
7 changes: 7 additions & 0 deletions manifests/generated/operator-csv.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,13 @@ spec:
- get
- list
- watch
- apiGroups:
- kubevirt.io
resources:
- kubevirts
verbs:
- get
- list
- apiGroups:
- subresources.kubevirt.io
resources:
Expand Down
7 changes: 7 additions & 0 deletions manifests/generated/rbac-operator.authorization.k8s.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,13 @@ rules:
- get
- list
- watch
- apiGroups:
- kubevirt.io
resources:
- kubevirts
verbs:
- get
- list
- apiGroups:
- subresources.kubevirt.io
resources:
Expand Down
11 changes: 11 additions & 0 deletions pkg/virt-operator/resource/generate/rbac/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,17 @@ func newViewClusterRole() *rbacv1.ClusterRole {
},
},
Rules: []rbacv1.PolicyRule{
{
APIGroups: []string{
GroupName,
},
Resources: []string{
"kubevirts",
},
Verbs: []string{
"get", "list",
},
},
{
APIGroups: []string{
GroupNameSubresources,
Expand Down

0 comments on commit 38ba821

Please sign in to comment.