Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign GitHub teams during bootstrap #41

Merged
merged 1 commit into from
Jun 16, 2020
Merged

Assign GitHub teams during bootstrap #41

merged 1 commit into from
Jun 16, 2020

Conversation

stefanprodan
Copy link
Member

This PR allows cluster admins to assign org teams during bootstrap. The teams are added with maintain permissions.

if !ghPersonal {
for _, team := range ghTeams {
if err := addGitHubTeam(ctx, ghHostname, ghOwner, ghRepository, ghToken, team, ghDefaultPermission); err != nil {
logFailure(err.Error())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect this to return as soon as it runs into an error, as the current code could result in no-one getting granted access to the repository while the bootstrap continues.

Copy link
Member Author

@stefanprodan stefanprodan Jun 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that was the intention as you can't make the operations transactional I opted for best-effort. Note that the user that runs the command has full access to the repo even if teams don't.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. In that case I would expect a partly successful bootstrap run to return a non-zero exit code as an indicator.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 📦 🚀

@stefanprodan stefanprodan merged commit 34ada41 into master Jun 16, 2020
@stefanprodan stefanprodan deleted the gh-teams branch June 16, 2020 14:31
ybelleguic pushed a commit to ybelleguic/flux2 that referenced this pull request Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants