Skip to content

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
google:mainfrom
sundeep8967:fix/cloudrun-service-account-and-secret-flags
Open

fix(cmd/adkgo): allow setting runtime service account and configurable secret name on Cloud Run deploy#1399
sundeep8967 wants to merge 3 commits into
google:mainfrom
sundeep8967:fix/cloudrun-service-account-and-secret-flags

Conversation

@sundeep8967

Copy link
Copy Markdown

Problem

adkgo deploy cloudrun always hardcoded --set-secrets=GOOGLE_API_KEY=GOOGLE_API_KEY:latest into the generated gcloud run deploy invocation and provided no option to specify a runtime service account. This resulted in:

  1. Hard dependency on a Secret Manager secret named GOOGLE_API_KEY, breaking deploys for users configuring API keys via environment variables or using different secret names.
  2. Silent fallback to the default compute service account without roles/secretmanager.secretAccessor permission, causing cryptic runtime revision failures after the container build completes.

Solution

  • Added --service_account / -A flag to cloudrunCmd to target a caller-specified runtime service account.
  • Added --secret_name flag (defaulting to GOOGLE_API_KEY) allowing custom secret names or disabling Secret Manager mounting by setting --secret_name="".
  • Documented Secret Manager and service account prerequisites in cloudrunCmd.Long help text.
  • Added unit tests in cmd/adkgo/internal/deploy/cloudrun/cloudrun_test.go verifying argument construction across all combinations.

Fixes #1343

Testing

  • Ran go test ./cmd/adkgo/internal/deploy/cloudrun -v (all tests pass).
  • Ran go test ./internal/ -run TestCopyrightHeader (all header checks pass).

…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>
@google-cla

google-cla Bot commented Aug 24, 2026

Copy link
Copy Markdown

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.

@sundeep8967 sundeep8967 reopened this Aug 24, 2026
@sundeep8967

Copy link
Copy Markdown
Author

@google-cla recheck

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.

adkgo deploy cloudrun: no way to set the runtime service account, and the Secret Manager requirement is undocumented

1 participant