Skip to content

Commit

Permalink
Allow tigera-network-admin to create any secret
Browse files Browse the repository at this point in the history
  • Loading branch information
gantony committed Nov 27, 2023
1 parent 770902a commit 939336d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
12 changes: 10 additions & 2 deletions pkg/render/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,15 @@ func (c *apiServerComponent) tigeraNetworkAdminClusterRole() *rbacv1.ClusterRole
Resources: []string{"securityeventwebhooks"},
Verbs: []string{"get", "list", "update", "patch", "create", "delete"},
},
// Allow the user to create and patch webhooks-secret secret.
// Allow the user to create secrets.
{
APIGroups: []string{""},
Resources: []string{
"secrets",
},
Verbs: []string{"create"},
},
// Allow the user to patch webhooks-secret secret.
{
APIGroups: []string{""},
Resources: []string{
Expand All @@ -1792,7 +1800,7 @@ func (c *apiServerComponent) tigeraNetworkAdminClusterRole() *rbacv1.ClusterRole
ResourceNames: []string{
"webhooks-secret",
},
Verbs: []string{"create", "patch"},
Verbs: []string{"patch"},
},
}

Expand Down
7 changes: 6 additions & 1 deletion pkg/render/apiserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1510,11 +1510,16 @@ var (
Resources: []string{"securityeventwebhooks"},
Verbs: []string{"get", "list", "update", "patch", "create", "delete"},
},
{
APIGroups: []string{""},
Resources: []string{"secrets"},
Verbs: []string{"create"},
},
{
APIGroups: []string{""},
Resources: []string{"secrets"},
ResourceNames: []string{"webhooks-secret"},
Verbs: []string{"create", "patch"},
Verbs: []string{"patch"},
},
}
)
Expand Down

0 comments on commit 939336d

Please sign in to comment.