Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
fix cloud run worker v2 vpc access
Browse files Browse the repository at this point in the history
  • Loading branch information
jakekaplan committed Apr 21, 2024
1 parent 250df53 commit 30a121f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion prefect_gcp/workers/cloud_run_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _remove_vpc_access_if_unset(self):
# if connector is the only key and it's not set, we'll remove it.
# otherwise we'll pass whatever the user has provided.
if len(vpc_access) == 1 and vpc_access.get("connector") is None:
self.job_body["template"]["template"]["vpcAccess"] = None
self.job_body["template"]["template"].pop("vpcAccess")

# noinspection PyMethodParameters
@validator("job_body")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cloud_run_worker_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def test_remove_vpc_access_if_unset(self, cloud_run_worker_v2_job_config):
cloud_run_worker_v2_job_config._remove_vpc_access_if_unset()

assert (
cloud_run_worker_v2_job_config.job_body["template"]["template"]["vpcAccess"]
is None
"vpcAccess"
not in cloud_run_worker_v2_job_config.job_body["template"]["template"]
)

def test_vpc_access_left_alone_if_connector_set(
Expand Down

0 comments on commit 30a121f

Please sign in to comment.