Skip to content

Group the roles in WIF setup script #83

@jerop

Description

@jerop

🟢 For better readability and maintainability, you could group these roles into an array and loop through them.

# Grant additional roles to the service account
print_info "Granting additional roles to Service Account..."
for role in \
  "roles/logging.logWriter" \
  "roles/monitoring.editor" \
  "roles/cloudtrace.agent" \
  "roles/aiplatform.user"
do
  gcloud projects add-iam-policy-binding "${GOOGLE_CLOUD_PROJECT}" \
    --role="$role" \
    --member="serviceAccount:${SERVICE_ACCOUNT_EMAIL}" \
    --condition=None
done

Originally posted by @gemini-cli[bot] in #82 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/authkind/cleanupIssues related to code cleanup and refactoringpriority/p2Important but can be addressed in a future release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions