Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-v0.18] chore: Audit template validator RBAC rules. #659

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading