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

Update placement of vpc-connector details for Cloud Run Work Pool #223

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions prefect_gcp/workers/cloud_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"annotations":
{
"run.googleapis.com/launch-stage": "BETA",
"run.googleapis.com/vpc-access-connector": "{{ vpc_connector_name }}"
}
},
"spec":
Expand Down Expand Up @@ -70,7 +69,15 @@
}
}
}
},
"metadata":
{
"annotations":
{
"run.googleapis.com/vpc-access-connector": "{{ vpc_connector_name }}"
}
}
},
},
"timeout": "{{ timeout }}",
"keep_job": "{{ keep_job }}"
Expand Down Expand Up @@ -101,7 +108,6 @@
{
"run.googleapis.com/my-custom-annotation": "{{ my_custom_annotation }}",
"run.googleapis.com/launch-stage": "BETA",
"run.googleapis.com/vpc-access-connector": "{{ vpc_connector_name }}"
},
...
},
Expand All @@ -126,17 +132,21 @@
{
"apiVersion": "run.googleapis.com/v1",
"kind": "Job",
"metadata":
"spec":
{
"name": "{{ name }}",
"annotations":
"template":
{
"run.googleapis.com/launch-stage": "BETA",
"run.googleapis.com/vpc-access-connector": "my-vpc-connector"
}
...
},
...
"metadata":
{
"annotations":
{
"run.googleapis.com/vpc-access-connector": "my-vpc-connector"
}
},
...
},
...
}
}
```
"""
Expand Down Expand Up @@ -191,7 +201,6 @@ def _get_default_job_body_template() -> Dict[str, Any]:
"annotations": {
# See: https://cloud.google.com/run/docs/troubleshooting#launch-stage-validation # noqa
"run.googleapis.com/launch-stage": "BETA",
"run.googleapis.com/vpc-access-connector": "{{ vpc_connector_name }}",
},
},
"spec": { # JobSpec
Expand Down Expand Up @@ -220,6 +229,11 @@ def _get_default_job_body_template() -> Dict[str, Any]:
}
},
},
"metadata": {
"annotations": {
"run.googleapis.com/vpc-access-connector": "{{ vpc_connector_name }}" # noqa
}
},
},
},
}
Expand Down
Loading