Skip to content

Commit

Permalink
Added pod permissions in etcd-role (#372) (#379)
Browse files Browse the repository at this point in the history
* Added pod permissions in etcd-role

* Updated unit tests

* Removed unneeded pod permissions
  • Loading branch information
aaronfern authored Jul 22, 2022
1 parent b793f8e commit 3ec4d7e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/etcd/templates/etcd-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@ rules:
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
13 changes: 13 additions & 0 deletions controllers/etcd_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,19 @@ func validateRole(instance *druidv1alpha1.Etcd, role *rbac.Role) {
"watch": Equal("watch"),
}),
}),
"": MatchFields(IgnoreExtras, Fields{
"APIGroups": MatchAllElements(stringArrayIterator, Elements{
"": Equal(""),
}),
"Resources": MatchAllElements(stringArrayIterator, Elements{
"pods": Equal("pods"),
}),
"Verbs": MatchAllElements(stringArrayIterator, Elements{
"list": Equal("list"),
"get": Equal("get"),
"watch": Equal("watch"),
}),
}),
}),
}))
}
Expand Down

0 comments on commit 3ec4d7e

Please sign in to comment.