Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

fix: remove client recv msg limit and add enums to types/__init__.py #60

Merged
merged 2 commits into from Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -28,7 +28,6 @@
_transport_registry["grpc"] = ClusterManagerGrpcTransport
_transport_registry["grpc_asyncio"] = ClusterManagerGrpcAsyncIOTransport


__all__ = (
"ClusterManagerTransport",
"ClusterManagerGrpcTransport",
Expand Down
Expand Up @@ -147,6 +147,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -165,6 +169,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

self._stubs = {} # type: Dict[str, Callable]
Expand All @@ -191,7 +199,7 @@ def create_channel(
) -> grpc.Channel:
"""Create and return a gRPC channel object.
Args:
address (Optionsl[str]): The host for the channel to use.
address (Optional[str]): The host for the channel to use.
credentials (Optional[~.Credentials]): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If
Expand Down
Expand Up @@ -192,6 +192,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -210,6 +214,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

# Run the base constructor.
Expand Down
1 change: 0 additions & 1 deletion google/cloud/container_v1/types/__init__.py
Expand Up @@ -113,7 +113,6 @@
ShieldedNodes,
)


__all__ = (
"NodeConfig",
"ShieldedInstanceConfig",
Expand Down
Expand Up @@ -28,7 +28,6 @@
_transport_registry["grpc"] = ClusterManagerGrpcTransport
_transport_registry["grpc_asyncio"] = ClusterManagerGrpcAsyncIOTransport


__all__ = (
"ClusterManagerTransport",
"ClusterManagerGrpcTransport",
Expand Down
Expand Up @@ -147,6 +147,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -165,6 +169,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

self._stubs = {} # type: Dict[str, Callable]
Expand All @@ -191,7 +199,7 @@ def create_channel(
) -> grpc.Channel:
"""Create and return a gRPC channel object.
Args:
address (Optionsl[str]): The host for the channel to use.
address (Optional[str]): The host for the channel to use.
credentials (Optional[~.Credentials]): The
authorization credentials to attach to requests. These
credentials identify this application to the service. If
Expand Down
Expand Up @@ -192,6 +192,10 @@ def __init__(
ssl_credentials=ssl_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
self._ssl_channel_credentials = ssl_credentials
else:
Expand All @@ -210,6 +214,10 @@ def __init__(
ssl_credentials=ssl_channel_credentials,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)

# Run the base constructor.
Expand Down
5 changes: 4 additions & 1 deletion google/cloud/container_v1beta1/types/__init__.py
Expand Up @@ -127,9 +127,10 @@
NotificationConfig,
ConfidentialNodes,
UpgradeEvent,
DatapathProvider,
UpgradeResourceType,
)


__all__ = (
"LinuxNodeConfig",
"NodeKubeletConfig",
Expand Down Expand Up @@ -242,4 +243,6 @@
"NotificationConfig",
"ConfidentialNodes",
"UpgradeEvent",
"DatapathProvider",
"UpgradeResourceType",
)
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-container.git",
"sha": "6a0fef7f30976357cc9f42c0213931d1a2c76eac"
"sha": "11e4b6aec2ace1f8129cf694d10d3edeb90029a5"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "df4fd38d040c5c8a0869936205bca13fb64b2cff",
"internalRef": "344443035"
"sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907",
"internalRef": "347055288"
}
},
{
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/gapic/container_v1/test_cluster_manager.py
Expand Up @@ -9181,6 +9181,10 @@ def test_cluster_manager_transport_channel_mtls_with_client_cert_source(
scopes=("https://www.googleapis.com/auth/cloud-platform",),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel
assert transport._ssl_channel_credentials == mock_ssl_cred
Expand Down Expand Up @@ -9222,6 +9226,10 @@ def test_cluster_manager_transport_channel_mtls_with_adc(transport_class):
scopes=("https://www.googleapis.com/auth/cloud-platform",),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel

Expand Down
8 changes: 8 additions & 0 deletions tests/unit/gapic/container_v1beta1/test_cluster_manager.py
Expand Up @@ -9501,6 +9501,10 @@ def test_cluster_manager_transport_channel_mtls_with_client_cert_source(
scopes=("https://www.googleapis.com/auth/cloud-platform",),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel
assert transport._ssl_channel_credentials == mock_ssl_cred
Expand Down Expand Up @@ -9542,6 +9546,10 @@ def test_cluster_manager_transport_channel_mtls_with_adc(transport_class):
scopes=("https://www.googleapis.com/auth/cloud-platform",),
ssl_credentials=mock_ssl_cred,
quota_project_id=None,
options=[
("grpc.max_send_message_length", -1),
("grpc.max_receive_message_length", -1),
],
)
assert transport.grpc_channel == mock_grpc_channel

Expand Down