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

pass arguments to gcloud deploy #357

Merged
merged 1 commit into from
Jun 27, 2022
Merged

Conversation

noursaidi
Copy link
Collaborator

I needed this so I can deploy the gcloud functions with the non-default service account (the default service account has editor role over a project by default).

Just passes the arguments onto the gcloud deploy call, so gcloud deploy parameters can be used. I only needed service-account, but figured power users may want to modify some of the other parameters too

@noursaidi noursaidi requested a review from grafnu June 7, 2022 15:19
if [ $# != 1 ]; then
echo Usage: $0 [project_id]
if (( $# < 1 )); then
echo Usage: $0 PROJECT_ID [options]
Copy link
Collaborator

Choose a reason for hiding this comment

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

What options are potentially interesting here? I've never had to add anything else, so just wondering... I'm a bit worried about making this too flexible since ideally the cloud-deploy part would be very regular/consistent...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I looked into it, I don't think any. I made some assumptions based on the names of some things but I don't think they're relevant anymore, so it's only the service account then.

@grafnu
Copy link
Collaborator

grafnu commented Jun 7, 2022 via email

@noursaidi
Copy link
Collaborator Author

It's the runtime service account (https://cloud.google.com/functions/docs/securing/function-identity#runtime_service_account) for the cloud function. An instance of a cloud function inherits its permissions from either the defined service account or the app engine default account if unspecified.

So by specifying the service account the cloud functions are associated with, their access to the GCP project can be controlled, and reduced from the everything access they have by default at the moment.

@grafnu
Copy link
Collaborator

grafnu commented Jun 7, 2022 via email

Copy link
Collaborator

@johnrandolph johnrandolph left a comment

Choose a reason for hiding this comment

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

I'm fine with this unless if there are specific options we should be adding to deploy_dashboard_gcloud that specifically invoke usable options in gcloud

@noursaidi noursaidi merged commit 845662c into faucetsdn:master Jun 27, 2022
@noursaidi noursaidi deleted the gcloudargs branch September 20, 2022 13:56
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.

None yet

3 participants