Add transport parameter to CloudRunHook and CloudRunExecuteJobOperator#60394
Conversation
…for API requests. This allows users to specify 'rest' or 'grpc' transport methods across CloudRunHook, CloudRunAsyncHook, CloudRunExecuteJobOperator, and CloudRunJobFinishedTrigger classes
…rt method in CloudRunHook, CloudRunAsyncHook, CloudRunExecuteJobOperator, and CloudRunJobFinishedTrigger classes. Adjusted related tests to reflect this change
…, defaulting to 'grpc' for backward compatibility. Adjusted related tests to accommodate this change
…CloudRunExecuteJobOperator to allow None as a valid option, enabling automatic transport selection. Updated related tests to validate this change
0bb4e52 to
8b604fd
Compare
…to 'grpc' when None is provided, ensuring backward compatibility. Updated related logic for consistency
|
@uranusjr could you please approve the changes and merge the PR |
|
Hello @shahar1! |
Thanks for informing, I'll take care of it later on - I had merged it before our discussion regarding the system tests. |

Fixes #60389
Summary
Adds support for specifying the transport protocol (REST or gRPC) in
CloudRunHook,CloudRunAsyncHook,CloudRunExecuteJobOperator, andCloudRunJobFinishedTriggerto resolve 404 errors in Docker environments where gRPC transport fails.Problem
CloudRunExecuteJobOperatorfails with 404 errors (NotFound: 404 Requested entity was not found) when running in Docker containers, even though the same Cloud Run jobs work correctly withgcloudCLI. This occurs because the Google Cloud Python client defaults to gRPC transport, which can fail in Docker environments due to network configurations, proxy settings, or firewall restrictions.Solution
Added an optional
transportparameter to:CloudRunHook- allows specifying 'rest' or 'grpc' transport forJobsClientCloudRunAsyncHook- allows specifying transport forJobsAsyncClientCloudRunExecuteJobOperator- passes transport parameter to the hookCloudRunJobFinishedTrigger- passes transport parameter to async hook for deferrable operations