mirror of
https://github.com/fluxcd/flux2.git
synced 2026-04-18 17:55:44 +00:00
Allow users to define team roles
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This commit is contained in:
parent
2eddcde609
commit
a096bd2d71
3 changed files with 13 additions and 1 deletions
|
|
@ -318,6 +318,10 @@ func (b *GitProviderBootstrapper) reconcileOrgRepository(ctx context.Context) (g
|
|||
b.logger.Actionf("reconciling repository permissions")
|
||||
for _, i := range teamAccessInfo {
|
||||
var err error
|
||||
// Don't reconcile team if team already exists and b.reconcile is false
|
||||
if team, err := repo.TeamAccess().Get(ctx, i.Name); err == nil && !b.reconcile && team != nil {
|
||||
continue
|
||||
}
|
||||
_, changed, err = repo.TeamAccess().Reconcile(ctx, i)
|
||||
if err != nil {
|
||||
warning = fmt.Errorf("failed to grant permissions to team: %w", ErrReconciledWithWarning)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue