tnk-ysk commented on code in PR #29689:
URL: https://github.com/apache/airflow/pull/29689#discussion_r1126306502
##########
airflow/providers/google/cloud/hooks/cloud_build.py:
##########
@@ -158,13 +159,17 @@ def create_build_without_waiting_for_result(
:param timeout: Optional, the amount of time, in seconds, to wait for
the request to complete.
Note that if `retry` is specified, the timeout applies to each
individual attempt.
:param metadata: Optional, additional metadata that is provided to the
method.
+ :param location: Optional, The location of the project.
+ If set to None or missing, global is used.
Review Comment:
I got a response from GCP support.
As a result, it turns out that the api_endpoint must be set on the client
when using a private pool or a non-global default pool.
https://github.com/googleapis/python-cloudbuild/blob/9cf4f4269b55213c1f84206923d3cdc0308ecf57/samples/snippets/quickstart.py#L35-L43
Sample code
```
from google.cloud.devtools import cloudbuild_v1
client =
cloudbuild_v1.CloudBuildClient(client_options={"api_endpoint":f"{region}-cloudbuild.googleapis.com:443"})
parent = f"projects/{project}/locations/{region}"
request = cloudbuild_v1.CreateBuildRequest(build={"steps":[{"name":"ubuntu",
"args":["echo", "hello"]}]}, parent=parent)
operation = client.create_build(request)
print(operation.result())
```
Similarly, I've found that some operators may not work with private pools or
a non-global default pool, but I'll fix that in another PR.
```
CloudBuildCancelBuildOperator
CloudBuildGetBuildOperator
CloudBuildListBuildsOperator
CloudBuildRetryBuildOperator
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]