[26.1] Qualify GCP Batch network and subnet names with the project ID - #23356
[26.1] Qualify GCP Batch network and subnet names with the project ID#23356ksuderman wants to merge 1 commit into
Conversation
|
Claude-identified-codex-verified Codex comment: -John This change looks mostly correct, and allowing already project-qualified network/subnet paths to pass through appears to address the cross-project/Shared VPC case. Could you update the PR description and the comment above this code to clarify the mechanism? Suggested code comment: # Preserve project-qualified paths so jobs can use a network or subnet
# owned by another project, such as a Shared VPC host project. Normalize
# bare names against the Batch job's project.I don’t think the implementation needs a larger redesign here, but correcting the explanation before merge would prevent the current rationale from becoming misleading documentation. |
The GCP Batch runner builds network interface paths as
global/networks/{name}andregions/{region}/subnetworks/{name}. These relative paths resolve against the project the Batch VMs are provisioned in, which is not necessarily the project that owns the VPC (e.g. Terra pet projects). When the two differ, job submission fails with a 404 on the network resource.The Fix
Bare
networkandsubnetnames are now qualified asprojects/{project_id}/global/networks/{name}andprojects/{project_id}/regions/{region}/subnetworks/{name}using the runner'sproject_idparameter. Values that already contain a/(full or relative resource paths) are passed through unchanged, so existing configurations keep working. The debug log now reports the fully qualified paths actually sent to the Batch API.Testing
./run_tests.sh -unit test/unit/app/jobs/test_gcp_batch_runner.pynetwork/subnetnames and aproject_idwhose VPC lives in a different project than the Batch VMs, submit a job, and confirm the network resolves instead of returning a 404.How to test the changes?
(Select all options that apply)
License