Skip to content

Commit

Permalink
Merge pull request #659 from kubevirt-bot/cherry-pick-622-to-release-…
Browse files Browse the repository at this point in the history
…v0.18

[release-v0.18] chore: Audit template validator RBAC rules.
  • Loading branch information
kubevirt-bot authored Aug 17, 2023
2 parents e8d6e89 + 5cc6022 commit 3458f0d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ rules:
resources:
- virtualmachines
verbs:
- get
- list
- watch
- apiGroups:
Expand Down
1 change: 0 additions & 1 deletion data/olm-catalog/ssp-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ spec:
resources:
- virtualmachines
verbs:
- get
- list
- watch
- apiGroups:
Expand Down
4 changes: 2 additions & 2 deletions internal/operands/template-validator/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
// +kubebuilder:rbac:groups=admissionregistration.k8s.io,resources=validatingwebhookconfigurations,verbs=get;list;watch;create;update;patch;delete

// RBAC for created roles
// +kubebuilder:rbac:groups=template.openshift.io,resources=templates,verbs=get;list;watch
// +kubebuilder:rbac:groups=kubevirt.io,resources=virtualmachines,verbs=get;list;watch
// +kubebuilder:rbac:groups=template.openshift.io,resources=templates,verbs=list;watch
// +kubebuilder:rbac:groups=kubevirt.io,resources=virtualmachines,verbs=list;watch

func WatchTypes() []operands.WatchType {
return []operands.WatchType{
Expand Down
4 changes: 2 additions & 2 deletions internal/operands/template-validator/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ func newClusterRole() *rbac.ClusterRole {
Rules: []rbac.PolicyRule{{
APIGroups: []string{templatev1.GroupName},
Resources: []string{"templates"},
Verbs: []string{"get", "list", "watch"},
Verbs: []string{"list", "watch"},
}, {
APIGroups: []string{kubevirt.GroupName},
Resources: []string{"virtualmachines"},
Verbs: []string{"get", "list", "watch"},
Verbs: []string{"list", "watch"},
}},
}
}
Expand Down

0 comments on commit 3458f0d

Please sign in to comment.