Skip to content

Commit

Permalink
Add hostendpoints get and list to tigera ui and admin users (#3484)
Browse files Browse the repository at this point in the history
This changeset adds `hostendpoints` get and list rbac for the built-in
`tigera-ui-user` and `tigera-network-admin` users.
  • Loading branch information
hjiawei authored Aug 30, 2024
1 parent 6eeefb1 commit dcb21df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/render/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,12 @@ func (c *apiServerComponent) tigeraUserClusterRole() *rbacv1.ClusterRole {
Resources: []string{"clusterinformations"},
Verbs: []string{"get", "list"},
},
// Access to hostendpoints from the UI ServiceGraph.
{
APIGroups: []string{"projectcalico.org"},
Resources: []string{"hostendpoints"},
Verbs: []string{"get", "list"},
},
// List and view the threat defense configuration
{
APIGroups: []string{"projectcalico.org"},
Expand Down Expand Up @@ -1664,6 +1670,12 @@ func (c *apiServerComponent) tigeraNetworkAdminClusterRole() *rbacv1.ClusterRole
Resources: []string{"clusterinformations"},
Verbs: []string{"get", "list"},
},
// Access to hostendpoints from the UI ServiceGraph.
{
APIGroups: []string{"projectcalico.org"},
Resources: []string{"hostendpoints"},
Verbs: []string{"get", "list"},
},
// Manage the threat defense configuration
{
APIGroups: []string{"projectcalico.org"},
Expand Down
10 changes: 10 additions & 0 deletions pkg/render/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,11 @@ var (
Resources: []string{"clusterinformations"},
Verbs: []string{"get", "list"},
},
{
APIGroups: []string{"projectcalico.org"},
Resources: []string{"hostendpoints"},
Verbs: []string{"get", "list"},
},
{
APIGroups: []string{"projectcalico.org"},
Resources: []string{
Expand Down Expand Up @@ -1445,6 +1450,11 @@ var (
Resources: []string{"clusterinformations"},
Verbs: []string{"get", "list"},
},
{
APIGroups: []string{"projectcalico.org"},
Resources: []string{"hostendpoints"},
Verbs: []string{"get", "list"},
},
{
APIGroups: []string{"projectcalico.org"},
Resources: []string{
Expand Down

0 comments on commit dcb21df

Please sign in to comment.