Skip to content

Commit c4145be

Browse files
committed
change env variable to explicit IS_DEPLOY_TO_CLOUD_RUN
1 parent 4e77c92 commit c4145be

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/google/adk/cli/cli_deploy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
ENV GOOGLE_GENAI_USE_VERTEXAI=1
4040
ENV GOOGLE_CLOUD_PROJECT={gcp_project_id}
4141
ENV GOOGLE_CLOUD_LOCATION={gcp_region}
42+
ENV IS_DEPLOY_TO_CLOUD_RUN=1
4243
4344
# Set up environment variables - End
4445

src/google/adk/cli/fast_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ async def _get_a2a_runner_async() -> Runner:
11031103
logger.info("Setting up A2A agent: %s", app_name)
11041104

11051105
try:
1106-
if "K_SERVICE" in os.environ: # Indicating Cloud Run
1106+
if "IS_DEPLOY_TO_CLOUD_RUN" in os.environ:
11071107
project_client = ProjectsClient()
11081108
project_resource_path = project_client.get_project(name=f"projects/{os.getenv('GOOGLE_CLOUD_PROJECT')}").name
11091109
project_number = project_resource_path.split('/')[-1]

0 commit comments

Comments
 (0)