Skip to content

Commit

Permalink
review: Different handling for empty contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwnasptd committed Jan 21, 2025
1 parent d02e878 commit abc4d8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/profiles_management/helpers/kfam.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ def create_rolebindings_for_profile_contributors(
existing_rolebindings = list_contributor_rolebindings(client, profile.name)
existing_contributor_roles = kfam_resources_list_to_roles_dict(existing_rolebindings)

for contributor in profile.contributors or []:
if not profile.contributors:
return

for contributor in profile.contributors:
if contributor.role not in existing_contributor_roles.get(contributor.name, []):
log.info("Will create RoleBinding for Contributor: %s", contributor)
client.apply(generate_contributor_rolebinding(contributor, profile.name))

0 comments on commit abc4d8c

Please sign in to comment.