Skip to content

Commit

Permalink
grant permissions on project secrets to admins as projects are created
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
  • Loading branch information
krancour committed Feb 27, 2024
1 parent 3c6a282 commit 4939335
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/controller/management/projects/projects.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ func (r *reconciler) ensureSecretPermissions(
Name: "kargo-api",
Namespace: r.cfg.KargoNamespace,
},
{
Kind: "ServiceAccount",
Name: "kargo-admin",
Namespace: r.cfg.KargoNamespace,
},
},
}
if err := r.createRoleBindingFn(ctx, roleBinding); err != nil {
Expand Down
5 changes: 5 additions & 0 deletions internal/webhook/project/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ func (w *webhook) ensureSecretPermissions(
Name: "kargo-api",
Namespace: w.cfg.KargoNamespace,
},
{
Kind: "ServiceAccount",
Name: "kargo-admin",
Namespace: w.cfg.KargoNamespace,
},
},
}
if err := w.createRoleBindingFn(ctx, roleBinding); err != nil {
Expand Down

0 comments on commit 4939335

Please sign in to comment.