feat(adkgo/deploy): add --env flag to agentengine deploy subcommand#975
Open
nuthalapativarun wants to merge 1 commit into
Open
feat(adkgo/deploy): add --env flag to agentengine deploy subcommand#975nuthalapativarun wants to merge 1 commit into
nuthalapativarun wants to merge 1 commit into
Conversation
Allow users to pass additional environment variables to the Agent Engine deployment via a repeatable --env=KEY=VALUE flag. Variables are appended after the built-in defaults (GOOGLE_CLOUD_REGION, NUM_WORKERS, OTel flags). For create: extra env vars are included in the DeploymentSpec.Env slice. For update: if --env vars are provided, DeploymentSpec is set with defaults plus the extra vars and "spec.deployment_spec" is added to the update mask. Parsing is validated: entries without "=" produce an error. Closes google#848
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
Root Cause / Motivation
adkgo deploy agentenginepasses a fixed set of environment variables to the Agent Engine deployment. Users that need custom env vars (e.g.VERTEX_AI_LOCATION,LOG_LEVEL, third-party API keys that are not secrets) have no way to inject them.Change
Add a repeatable
--env=KEY=VALUEflag to theagentenginedeploy subcommand:On create: extra env vars are appended after the built-in defaults (
GOOGLE_CLOUD_REGION,NUM_WORKERS, OTel flags) inDeploymentSpec.Env.On update: if
--envflags are provided,DeploymentSpecis set with defaults + extra vars and"spec.deployment_spec"is added to the update mask. If no--envflags are given, update behavior is unchanged.Values containing
=are handled correctly (URL=http://x?a=1&b=2splits on the first=only). Entries without=return a clear error.Testing Plan
Unit Tests:
TestParseEnvVarsinagentengine_test.gocovering: nil input, single var, value-contains-equals, empty value, multiple vars, missing-equals error, empty-string error.Manual End-to-End (E2E) Tests:
The flag wires correctly into the cobra command. The
parseEnvVarsfunction can be verified without a live GCP project; the proto field is identical to the existing hardcoded env var entries.Checklist