diff --git a/google/cloud/container_v1/services/cluster_manager/async_client.py b/google/cloud/container_v1/services/cluster_manager/async_client.py index d8d803b6..ce2e4858 100644 --- a/google/cloud/container_v1/services/cluster_manager/async_client.py +++ b/google/cloud/container_v1/services/cluster_manager/async_client.py @@ -263,7 +263,7 @@ async def list_clusters( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, parent]) if request is not None and has_flattened_params: @@ -378,7 +378,7 @@ async def get_cluster( A Google Kubernetes Engine cluster. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, name]) if request is not None and has_flattened_params: @@ -509,7 +509,7 @@ async def create_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster, parent]) if request is not None and has_flattened_params: @@ -628,7 +628,7 @@ async def update_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, update, name]) if request is not None and has_flattened_params: @@ -865,7 +865,7 @@ async def set_logging_service( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, logging_service, name] @@ -1002,7 +1002,7 @@ async def set_monitoring_service( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, monitoring_service, name] @@ -1126,7 +1126,7 @@ async def set_addons_config( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, addons_config, name]) if request is not None and has_flattened_params: @@ -1260,7 +1260,7 @@ async def set_locations( ) # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, locations, name]) if request is not None and has_flattened_params: @@ -1393,7 +1393,7 @@ async def update_master( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, master_version, name]) if request is not None and has_flattened_params: @@ -1569,7 +1569,7 @@ async def delete_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, name]) if request is not None and has_flattened_params: @@ -1671,7 +1671,7 @@ async def list_operations( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone]) if request is not None and has_flattened_params: @@ -1787,7 +1787,7 @@ async def get_operation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, operation_id, name]) if request is not None and has_flattened_params: @@ -1899,7 +1899,7 @@ async def cancel_operation( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, operation_id, name]) if request is not None and has_flattened_params: @@ -1997,7 +1997,7 @@ async def get_server_config( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, name]) if request is not None and has_flattened_params: @@ -2169,7 +2169,7 @@ async def list_node_pools( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, parent]) if request is not None and has_flattened_params: @@ -2304,7 +2304,7 @@ async def get_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id, name]) if request is not None and has_flattened_params: @@ -2432,7 +2432,7 @@ async def create_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool, parent]) if request is not None and has_flattened_params: @@ -2554,7 +2554,7 @@ async def delete_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id, name]) if request is not None and has_flattened_params: @@ -2692,7 +2692,7 @@ async def rollback_node_pool_upgrade( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id, name]) if request is not None and has_flattened_params: @@ -2918,7 +2918,7 @@ async def set_legacy_abac( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, enabled, name]) if request is not None and has_flattened_params: @@ -3031,7 +3031,7 @@ async def start_ip_rotation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, name]) if request is not None and has_flattened_params: @@ -3141,7 +3141,7 @@ async def complete_ip_rotation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, name]) if request is not None and has_flattened_params: @@ -3313,7 +3313,7 @@ async def set_network_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, network_policy, name]) if request is not None and has_flattened_params: @@ -3430,7 +3430,7 @@ async def set_maintenance_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, maintenance_policy, name] diff --git a/google/cloud/container_v1/services/cluster_manager/client.py b/google/cloud/container_v1/services/cluster_manager/client.py index 56511fe5..7d67e802 100644 --- a/google/cloud/container_v1/services/cluster_manager/client.py +++ b/google/cloud/container_v1/services/cluster_manager/client.py @@ -455,7 +455,7 @@ def list_clusters( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, parent]) if request is not None and has_flattened_params: @@ -560,7 +560,7 @@ def get_cluster( A Google Kubernetes Engine cluster. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, name]) if request is not None and has_flattened_params: @@ -681,7 +681,7 @@ def create_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster, parent]) if request is not None and has_flattened_params: @@ -800,7 +800,7 @@ def update_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, update, name]) if request is not None and has_flattened_params: @@ -1041,7 +1041,7 @@ def set_logging_service( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, logging_service, name] @@ -1178,7 +1178,7 @@ def set_monitoring_service( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, monitoring_service, name] @@ -1302,7 +1302,7 @@ def set_addons_config( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, addons_config, name]) if request is not None and has_flattened_params: @@ -1436,7 +1436,7 @@ def set_locations( ) # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, locations, name]) if request is not None and has_flattened_params: @@ -1569,7 +1569,7 @@ def update_master( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, master_version, name]) if request is not None and has_flattened_params: @@ -1746,7 +1746,7 @@ def delete_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, name]) if request is not None and has_flattened_params: @@ -1838,7 +1838,7 @@ def list_operations( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone]) if request is not None and has_flattened_params: @@ -1944,7 +1944,7 @@ def get_operation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, operation_id, name]) if request is not None and has_flattened_params: @@ -2046,7 +2046,7 @@ def cancel_operation( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, operation_id, name]) if request is not None and has_flattened_params: @@ -2144,7 +2144,7 @@ def get_server_config( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, name]) if request is not None and has_flattened_params: @@ -2307,7 +2307,7 @@ def list_node_pools( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, parent]) if request is not None and has_flattened_params: @@ -2432,7 +2432,7 @@ def get_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id, name]) if request is not None and has_flattened_params: @@ -2550,7 +2550,7 @@ def create_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool, parent]) if request is not None and has_flattened_params: @@ -2672,7 +2672,7 @@ def delete_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id, name]) if request is not None and has_flattened_params: @@ -2800,7 +2800,7 @@ def rollback_node_pool_upgrade( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id, name]) if request is not None and has_flattened_params: @@ -3030,7 +3030,7 @@ def set_legacy_abac( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, enabled, name]) if request is not None and has_flattened_params: @@ -3143,7 +3143,7 @@ def start_ip_rotation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, name]) if request is not None and has_flattened_params: @@ -3253,7 +3253,7 @@ def complete_ip_rotation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, name]) if request is not None and has_flattened_params: @@ -3426,7 +3426,7 @@ def set_network_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, network_policy, name]) if request is not None and has_flattened_params: @@ -3543,7 +3543,7 @@ def set_maintenance_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, maintenance_policy, name] diff --git a/google/cloud/container_v1/services/cluster_manager/transports/grpc.py b/google/cloud/container_v1/services/cluster_manager/transports/grpc.py index daf92853..f9d6bf8f 100644 --- a/google/cloud/container_v1/services/cluster_manager/transports/grpc.py +++ b/google/cloud/container_v1/services/cluster_manager/transports/grpc.py @@ -159,8 +159,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py b/google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py index 4ccf1d7d..0e36561f 100644 --- a/google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py +++ b/google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py @@ -204,8 +204,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/container_v1/types/cluster_service.py b/google/cloud/container_v1/types/cluster_service.py index 04be455a..509e0402 100644 --- a/google/cloud/container_v1/types/cluster_service.py +++ b/google/cloud/container_v1/types/cluster_service.py @@ -220,10 +220,9 @@ class NodeKubeletConfig(proto.Message): containers that specify CPU limits. This option is enabled by default which makes kubelet use CFS quota - (https://www.kernel.org/doc/Documentation/scheduler/sched- - bwc.txt) to enforce container CPU limits. - Otherwise, CPU limits will not be enforced at - all. + (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) + to enforce container CPU limits. Otherwise, CPU + limits will not be enforced at all. Disable this option to mitigate CPU throttling problems while still having your pods to be in @@ -335,16 +334,15 @@ class NodeConfig(proto.Message): undefined and conflicts should be avoided. For more information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/overview/working- - with-objects/labels/ + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ local_ssd_count (int): The number of local SSD disks to be attached to the node. The limit for this value is dependent upon the maximum number of disks available on a machine per zone. See: - https://cloud.google.com/compute/docs/disks/local- - ssd for more information. + https://cloud.google.com/compute/docs/disks/local-ssd + for more information. tags (Sequence[str]): The list of instance tags applied to all nodes. Tags are used to identify valid sources @@ -367,8 +365,8 @@ class NodeConfig(proto.Message): Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced') - If unspecified, the default disk type is 'pd- - standard' + If unspecified, the default disk type is + 'pd-standard' min_cpu_platform (str): Minimum CPU platform to be used by this instance. The instance may be scheduled on the specified or newer CPU @@ -385,8 +383,7 @@ class NodeConfig(proto.Message): each node. For more information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/configuration/taint- - and-toleration/ + https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ sandbox_config (google.cloud.container_v1.types.SandboxConfig): Sandbox configuration for this node. node_group (str): @@ -670,8 +667,7 @@ class MasterAuth(proto.Message): will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see: - https://cloud.google.com/kubernetes- - engine/docs/how-to/api-server-authentication + https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication password (str): The password to use for HTTP basic authentication to the master endpoint. Because @@ -684,8 +680,7 @@ class MasterAuth(proto.Message): will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see: - https://cloud.google.com/kubernetes- - engine/docs/how-to/api-server-authentication + https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication client_certificate_config (google.cloud.container_v1.types.ClientCertificateConfig): Configuration for client certificate authentication on the cluster. For clusters @@ -746,8 +741,7 @@ class AddonsConfig(proto.Message): Console to manage and monitor your Kubernetes clusters, workloads and applications. For more information, see: - https://cloud.google.com/kubernetes- - engine/docs/concepts/dashboards + https://cloud.google.com/kubernetes-engine/docs/concepts/dashboards network_policy_config (google.cloud.container_v1.types.NetworkPolicyConfig): Configuration for NetworkPolicy. This only tracks whether the addon is enabled or not on @@ -1052,8 +1046,7 @@ class LegacyAbac(proto.Message): class NetworkPolicy(proto.Message): r"""Configuration options for the NetworkPolicy feature. - https://kubernetes.io/docs/concepts/services- - networking/networkpolicies/ + https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ Attributes: provider (google.cloud.container_v1.types.NetworkPolicy.Provider): @@ -3061,17 +3054,18 @@ class NodeManagement(proto.Message): Attributes: auto_upgrade (bool): - A flag that specifies whether node auto- - pgrade is enabled for the node pool. If enabled, - node auto-upgrade helps keep the nodes in your - node pool up to date with the latest release - version of Kubernetes. + A flag that specifies whether node + auto-upgrade is enabled for the node pool. If + enabled, node auto-upgrade helps keep the nodes + in your node pool up to date with the latest + release version of Kubernetes. auto_repair (bool): - A flag that specifies whether the node auto- - epair is enabled for the node pool. If enabled, - the nodes in this node pool will be monitored - and, if they fail health checks too many times, - an automatic repair action will be triggered. + A flag that specifies whether the node + auto-repair is enabled for the node pool. If + enabled, the nodes in this node pool will be + monitored and, if they fail health checks too + many times, an automatic repair action will be + triggered. upgrade_options (google.cloud.container_v1.types.AutoUpgradeOptions): Specifies the Auto Upgrade knobs for the node pool. @@ -3151,9 +3145,9 @@ class MaintenanceWindow(proto.Message): This field is a member of `oneof`_ ``policy``. maintenance_exclusions (Sequence[google.cloud.container_v1.types.MaintenanceWindow.MaintenanceExclusionsEntry]): - Exceptions to maintenance window. Non- - mergency maintenance should not occur in these - windows. + Exceptions to maintenance window. + Non-emergency maintenance should not occur in + these windows. """ daily_maintenance_window = proto.Field( @@ -3489,8 +3483,8 @@ class AutoprovisioningNodePoolDefaults(proto.Message): Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced') - If unspecified, the default disk type is 'pd- - standard' + If unspecified, the default disk type is + 'pd-standard' shielded_instance_config (google.cloud.container_v1.types.ShieldedInstanceConfig): Shielded Instance options. boot_disk_kms_key (str): @@ -4184,9 +4178,8 @@ class DatabaseEncryption(proto.Message): Denotes the state of etcd encryption. key_name (str): Name of CloudKMS key to use for the - encryption of secrets in etcd. Ex. projects/my- - project/locations/global/keyRings/my- - ring/cryptoKeys/my-key + encryption of secrets in etcd. Ex. + projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key """ class State(proto.Enum): @@ -4294,12 +4287,12 @@ class UsableSubnetwork(proto.Message): Attributes: subnetwork (str): Subnetwork Name. - Example: projects/my-project/regions/us- - central1/subnetworks/my-subnet + Example: + projects/my-project/regions/us-central1/subnetworks/my-subnet network (str): Network Name. - Example: projects/my-project/global/networks/my- - network + Example: + projects/my-project/global/networks/my-network ip_cidr_range (str): The range of internal addresses that are owned by this subnetwork. diff --git a/google/cloud/container_v1beta1/services/cluster_manager/async_client.py b/google/cloud/container_v1beta1/services/cluster_manager/async_client.py index 6d805db9..808eef54 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/async_client.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/async_client.py @@ -254,7 +254,7 @@ async def list_clusters( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone]) if request is not None and has_flattened_params: @@ -359,7 +359,7 @@ async def get_cluster( A Google Kubernetes Engine cluster. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -480,7 +480,7 @@ async def create_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster]) if request is not None and has_flattened_params: @@ -589,7 +589,7 @@ async def update_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, update]) if request is not None and has_flattened_params: @@ -816,7 +816,7 @@ async def set_logging_service( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, logging_service]) if request is not None and has_flattened_params: @@ -941,7 +941,7 @@ async def set_monitoring_service( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, monitoring_service]) if request is not None and has_flattened_params: @@ -1053,7 +1053,7 @@ async def set_addons_config( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, addons_config]) if request is not None and has_flattened_params: @@ -1177,7 +1177,7 @@ async def set_locations( ) # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, locations]) if request is not None and has_flattened_params: @@ -1300,7 +1300,7 @@ async def update_master( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, master_version]) if request is not None and has_flattened_params: @@ -1466,7 +1466,7 @@ async def delete_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -1567,7 +1567,7 @@ async def list_operations( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone]) if request is not None and has_flattened_params: @@ -1675,7 +1675,7 @@ async def get_operation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, operation_id]) if request is not None and has_flattened_params: @@ -1777,7 +1777,7 @@ async def cancel_operation( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, operation_id]) if request is not None and has_flattened_params: @@ -1866,7 +1866,7 @@ async def get_server_config( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone]) if request is not None and has_flattened_params: @@ -1972,7 +1972,7 @@ async def list_node_pools( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -2187,7 +2187,7 @@ async def get_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id]) if request is not None and has_flattened_params: @@ -2305,7 +2305,7 @@ async def create_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool]) if request is not None and has_flattened_params: @@ -2417,7 +2417,7 @@ async def delete_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id]) if request is not None and has_flattened_params: @@ -2544,7 +2544,7 @@ async def rollback_node_pool_upgrade( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id]) if request is not None and has_flattened_params: @@ -2665,7 +2665,7 @@ async def set_node_pool_management( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, node_pool_id, management] @@ -2797,7 +2797,7 @@ async def set_labels( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, resource_labels, label_fingerprint] @@ -2914,7 +2914,7 @@ async def set_legacy_abac( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, enabled]) if request is not None and has_flattened_params: @@ -3017,7 +3017,7 @@ async def start_ip_rotation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -3117,7 +3117,7 @@ async def complete_ip_rotation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -3279,7 +3279,7 @@ async def set_network_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, network_policy]) if request is not None and has_flattened_params: @@ -3385,7 +3385,7 @@ async def set_maintenance_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, maintenance_policy]) if request is not None and has_flattened_params: @@ -3469,7 +3469,7 @@ async def list_usable_subnetworks( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -3558,7 +3558,7 @@ async def list_locations( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: diff --git a/google/cloud/container_v1beta1/services/cluster_manager/client.py b/google/cloud/container_v1beta1/services/cluster_manager/client.py index 17272b44..5a469ca9 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/client.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/client.py @@ -446,7 +446,7 @@ def list_clusters( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone]) if request is not None and has_flattened_params: @@ -541,7 +541,7 @@ def get_cluster( A Google Kubernetes Engine cluster. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -652,7 +652,7 @@ def create_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster]) if request is not None and has_flattened_params: @@ -761,7 +761,7 @@ def update_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, update]) if request is not None and has_flattened_params: @@ -992,7 +992,7 @@ def set_logging_service( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, logging_service]) if request is not None and has_flattened_params: @@ -1117,7 +1117,7 @@ def set_monitoring_service( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, monitoring_service]) if request is not None and has_flattened_params: @@ -1229,7 +1229,7 @@ def set_addons_config( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, addons_config]) if request is not None and has_flattened_params: @@ -1353,7 +1353,7 @@ def set_locations( ) # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, locations]) if request is not None and has_flattened_params: @@ -1476,7 +1476,7 @@ def update_master( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, master_version]) if request is not None and has_flattened_params: @@ -1643,7 +1643,7 @@ def delete_cluster( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -1734,7 +1734,7 @@ def list_operations( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone]) if request is not None and has_flattened_params: @@ -1832,7 +1832,7 @@ def get_operation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, operation_id]) if request is not None and has_flattened_params: @@ -1924,7 +1924,7 @@ def cancel_operation( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, operation_id]) if request is not None and has_flattened_params: @@ -2013,7 +2013,7 @@ def get_server_config( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone]) if request is not None and has_flattened_params: @@ -2109,7 +2109,7 @@ def list_node_pools( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -2315,7 +2315,7 @@ def get_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id]) if request is not None and has_flattened_params: @@ -2423,7 +2423,7 @@ def create_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool]) if request is not None and has_flattened_params: @@ -2535,7 +2535,7 @@ def delete_node_pool( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id]) if request is not None and has_flattened_params: @@ -2652,7 +2652,7 @@ def rollback_node_pool_upgrade( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, node_pool_id]) if request is not None and has_flattened_params: @@ -2775,7 +2775,7 @@ def set_node_pool_management( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, node_pool_id, management] @@ -2907,7 +2907,7 @@ def set_labels( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any( [project_id, zone, cluster_id, resource_labels, label_fingerprint] @@ -3023,7 +3023,7 @@ def set_legacy_abac( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, enabled]) if request is not None and has_flattened_params: @@ -3126,7 +3126,7 @@ def start_ip_rotation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -3226,7 +3226,7 @@ def complete_ip_rotation( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id]) if request is not None and has_flattened_params: @@ -3389,7 +3389,7 @@ def set_network_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, network_policy]) if request is not None and has_flattened_params: @@ -3495,7 +3495,7 @@ def set_maintenance_policy( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([project_id, zone, cluster_id, maintenance_policy]) if request is not None and has_flattened_params: @@ -3579,7 +3579,7 @@ def list_usable_subnetworks( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: @@ -3658,7 +3658,7 @@ def list_locations( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([parent]) if request is not None and has_flattened_params: diff --git a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py index f933d5f1..6c2dcaa3 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py @@ -159,8 +159,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py index 94abf61a..f3ee9fc4 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py @@ -204,8 +204,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, diff --git a/google/cloud/container_v1beta1/types/cluster_service.py b/google/cloud/container_v1beta1/types/cluster_service.py index c217b297..84e8cf18 100644 --- a/google/cloud/container_v1beta1/types/cluster_service.py +++ b/google/cloud/container_v1beta1/types/cluster_service.py @@ -239,10 +239,9 @@ class NodeKubeletConfig(proto.Message): containers that specify CPU limits. This option is enabled by default which makes kubelet use CFS quota - (https://www.kernel.org/doc/Documentation/scheduler/sched- - bwc.txt) to enforce container CPU limits. - Otherwise, CPU limits will not be enforced at - all. + (https://www.kernel.org/doc/Documentation/scheduler/sched-bwc.txt) + to enforce container CPU limits. Otherwise, CPU + limits will not be enforced at all. Disable this option to mitigate CPU throttling problems while still having your pods to be in @@ -354,16 +353,15 @@ class NodeConfig(proto.Message): undefined and conflicts should be avoided. For more information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/overview/working- - with-objects/labels/ + https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ local_ssd_count (int): The number of local SSD disks to be attached to the node. The limit for this value is dependent upon the maximum number of disks available on a machine per zone. See: - https://cloud.google.com/compute/docs/disks/local- - ssd for more information. + https://cloud.google.com/compute/docs/disks/local-ssd + for more information. tags (Sequence[str]): The list of instance tags applied to all nodes. Tags are used to identify valid sources @@ -398,8 +396,8 @@ class NodeConfig(proto.Message): Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced') - If unspecified, the default disk type is 'pd- - standard' + If unspecified, the default disk type is + 'pd-standard' min_cpu_platform (str): Minimum CPU platform to be used by this instance. The instance may be scheduled on the specified or newer CPU @@ -416,8 +414,7 @@ class NodeConfig(proto.Message): each node. For more information, including usage and the valid values, see: - https://kubernetes.io/docs/concepts/configuration/taint- - and-toleration/ + https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ boot_disk_kms_key (str): The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be @@ -755,8 +752,7 @@ class MasterAuth(proto.Message): will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see: - https://cloud.google.com/kubernetes- - engine/docs/how-to/api-server-authentication + https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication password (str): The password to use for HTTP basic authentication to the master endpoint. Because @@ -769,8 +765,7 @@ class MasterAuth(proto.Message): will be removed in GKE control plane versions 1.19 and newer. For a list of recommended authentication methods, see: - https://cloud.google.com/kubernetes- - engine/docs/how-to/api-server-authentication + https://cloud.google.com/kubernetes-engine/docs/how-to/api-server-authentication client_certificate_config (google.cloud.container_v1beta1.types.ClientCertificateConfig): Configuration for client certificate authentication on the cluster. For clusters @@ -830,8 +825,7 @@ class AddonsConfig(proto.Message): Console to manage and monitor your Kubernetes clusters, workloads and applications. For more information, see: - https://cloud.google.com/kubernetes- - engine/docs/concepts/dashboards + https://cloud.google.com/kubernetes-engine/docs/concepts/dashboards network_policy_config (google.cloud.container_v1beta1.types.NetworkPolicyConfig): Configuration for NetworkPolicy. This only tracks whether the addon is enabled or not on @@ -1177,8 +1171,7 @@ class LegacyAbac(proto.Message): class NetworkPolicy(proto.Message): r"""Configuration options for the NetworkPolicy feature. - https://kubernetes.io/docs/concepts/services- - networking/networkpolicies/ + https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ Attributes: provider (google.cloud.container_v1beta1.types.NetworkPolicy.Provider): @@ -3507,9 +3500,9 @@ class MaintenanceWindow(proto.Message): This field is a member of `oneof`_ ``policy``. maintenance_exclusions (Sequence[google.cloud.container_v1beta1.types.MaintenanceWindow.MaintenanceExclusionsEntry]): - Exceptions to maintenance window. Non- - mergency maintenance should not occur in these - windows. + Exceptions to maintenance window. + Non-emergency maintenance should not occur in + these windows. """ daily_maintenance_window = proto.Field( @@ -3858,8 +3851,8 @@ class AutoprovisioningNodePoolDefaults(proto.Message): Type of the disk attached to each node (e.g. 'pd-standard', 'pd-ssd' or 'pd-balanced') - If unspecified, the default disk type is 'pd- - standard' + If unspecified, the default disk type is + 'pd-standard' shielded_instance_config (google.cloud.container_v1beta1.types.ShieldedInstanceConfig): Shielded Instance options. boot_disk_kms_key (str): @@ -4489,12 +4482,12 @@ class UsableSubnetwork(proto.Message): Attributes: subnetwork (str): Subnetwork Name. - Example: projects/my-project/regions/us- - central1/subnetworks/my-subnet + Example: + projects/my-project/regions/us-central1/subnetworks/my-subnet network (str): Network Name. - Example: projects/my-project/global/networks/my- - network + Example: + projects/my-project/global/networks/my-network ip_cidr_range (str): The range of internal addresses that are owned by this subnetwork. @@ -4691,9 +4684,8 @@ class DatabaseEncryption(proto.Message): Denotes the state of etcd encryption. key_name (str): Name of CloudKMS key to use for the - encryption of secrets in etcd. Ex. projects/my- - project/locations/global/keyRings/my- - ring/cryptoKeys/my-key + encryption of secrets in etcd. Ex. + projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key """ class State(proto.Enum): diff --git a/tests/unit/gapic/container_v1/test_cluster_manager.py b/tests/unit/gapic/container_v1/test_cluster_manager.py index aa72d3fe..8096c042 100644 --- a/tests/unit/gapic/container_v1/test_cluster_manager.py +++ b/tests/unit/gapic/container_v1/test_cluster_manager.py @@ -512,21 +512,28 @@ def test_cluster_manager_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (ClusterManagerClient, transports.ClusterManagerGrpcTransport, "grpc"), + ( + ClusterManagerClient, + transports.ClusterManagerGrpcTransport, + "grpc", + grpc_helpers, + ), ( ClusterManagerAsyncClient, transports.ClusterManagerGrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_cluster_manager_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -562,6 +569,72 @@ def test_cluster_manager_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + ClusterManagerClient, + transports.ClusterManagerGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ClusterManagerAsyncClient, + transports.ClusterManagerGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_cluster_manager_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "container.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="container.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [cluster_service.ListClustersRequest, dict,]) def test_list_clusters(request_type, transport: str = "grpc"): client = ClusterManagerClient( diff --git a/tests/unit/gapic/container_v1beta1/test_cluster_manager.py b/tests/unit/gapic/container_v1beta1/test_cluster_manager.py index 74689c75..c191b22d 100644 --- a/tests/unit/gapic/container_v1beta1/test_cluster_manager.py +++ b/tests/unit/gapic/container_v1beta1/test_cluster_manager.py @@ -514,21 +514,28 @@ def test_cluster_manager_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (ClusterManagerClient, transports.ClusterManagerGrpcTransport, "grpc"), + ( + ClusterManagerClient, + transports.ClusterManagerGrpcTransport, + "grpc", + grpc_helpers, + ), ( ClusterManagerAsyncClient, transports.ClusterManagerGrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_cluster_manager_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -564,6 +571,72 @@ def test_cluster_manager_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + ClusterManagerClient, + transports.ClusterManagerGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ClusterManagerAsyncClient, + transports.ClusterManagerGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_cluster_manager_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "container.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="container.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [cluster_service.ListClustersRequest, dict,]) def test_list_clusters(request_type, transport: str = "grpc"): client = ClusterManagerClient(