Description
Happy to submit a PR for this as it's quite a simple change.
Describe the bug
Deppoying directly to cloud run using 'adk deploy cloud_run' is very easy and simple but it does lead to some minor issues when doing development due to lalck of CORS headers. This shows up when whipping up some Javascript to talk to the agent.
It would be helpful to allow the addition of --allow-origins which could be put into the generated Dockerfile
To Reproduce
Steps to reproduce the behavior:
- Deploy an agent to cloud run
- Attempt to make a 'fetch' from inside your Javascript
Expected behavior
Data should be fetched from the agent. Instead a CORS error is produced
Desktop (please complete the following information):
- OS: MAc/Chrome-137
- Python version(python -V): 3.13.4
- ADK version(pip show google-adk): 1.2.1
Additional context
The workaround is to deploy the service then to go service info in Google Cloud Console and edit the source to manually add --allow_origins to the Dockerfile then redeploy.
Two other points:
- An alternate fix would be to mention this in the documentation.
- Or in the docs simply provide the Dockerfile template as used and have the user manually add it and run 'gcloud run deploy .'