fix deletion on conflict resolution

This commit is contained in:
Felix Kunde 2020-02-25 12:58:20 +01:00
parent b38d72d9a2
commit c3c413f0d1
1 changed files with 8 additions and 0 deletions

View File

@ -508,6 +508,14 @@ func (c *Controller) submitRBACCredentials(event ClusterEvent) error {
return fmt.Errorf("could not create pod service account %q : %v", c.opConfig.PodServiceAccountName, err)
}
// create role only if binding references a role
// if not role is empty and we rely on an existing cluster role
if c.PodServiceAccountRole != nil {
if err := c.createRole(namespace); err != nil {
return fmt.Errorf("could not create role %q : %v", c.PodServiceAccountRole.Name, err)
}
}
if err := c.createRoleBindings(namespace); err != nil {
return fmt.Errorf("could not create role binding %q : %v", c.PodServiceAccountRoleBinding.Name, err)
}