fix(cmd/adkgo): allow setting runtime service account and configurable secret name on Cloud Run deploy - #1399
Open
sundeep8967 wants to merge 3 commits into
Conversation
…e secret name on Cloud Run deploy - Add --service_account (-A) flag to specify runtime service account for Cloud Run revision. - Add --secret_name flag (default: GOOGLE_API_KEY) to configure or disable Secret Manager mounting. - Document Secret Manager and service account prerequisites in command help. - Add unit tests in cloudrun_test.go covering parameter construction. Fixes google#1343 Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Author
|
@google-cla recheck |
Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
adkgo deploy cloudrunalways hardcoded--set-secrets=GOOGLE_API_KEY=GOOGLE_API_KEY:latestinto the generatedgcloud run deployinvocation and provided no option to specify a runtime service account. This resulted in:GOOGLE_API_KEY, breaking deploys for users configuring API keys via environment variables or using different secret names.roles/secretmanager.secretAccessorpermission, causing cryptic runtime revision failures after the container build completes.Solution
--service_account/-Aflag tocloudrunCmdto target a caller-specified runtime service account.--secret_nameflag (defaulting toGOOGLE_API_KEY) allowing custom secret names or disabling Secret Manager mounting by setting--secret_name="".cloudrunCmd.Longhelp text.cmd/adkgo/internal/deploy/cloudrun/cloudrun_test.goverifying argument construction across all combinations.Fixes #1343
Testing
go test ./cmd/adkgo/internal/deploy/cloudrun -v(all tests pass).go test ./internal/ -run TestCopyrightHeader(all header checks pass).