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

Commit

Permalink
Update placement of vpc-connector details for Cloud Run Work Pool (#223)
Browse files Browse the repository at this point in the history
* Google changed where the vpc-connector details are included in the API

* undo bad format
  • Loading branch information
JohnLemmonMedely authored Feb 23, 2024
1 parent 72bc6ea commit ea32a84
Showing 1 changed file with 26 additions and 12 deletions.
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

0 comments on commit ea32a84

Please sign in to comment.