diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index fccaa8e8..889f77df 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1 + digest: sha256:c43f1d918bcf817d337aa29ff833439494a158a0831508fda4ec75dc4c0d0320 diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 23000c05..8057a769 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10'] + python: ['3.7', '3.8', '3.9', '3.10', '3.11'] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.kokoro/samples/python3.11/common.cfg b/.kokoro/samples/python3.11/common.cfg new file mode 100644 index 00000000..f956645a --- /dev/null +++ b/.kokoro/samples/python3.11/common.cfg @@ -0,0 +1,40 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.11" +} + +# Declare build specific Cloud project. +env_vars: { + key: "BUILD_SPECIFIC_GCLOUD_PROJECT" + value: "python-docs-samples-tests-311" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-container/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-container/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.11/continuous.cfg b/.kokoro/samples/python3.11/continuous.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/python3.11/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.11/periodic-head.cfg b/.kokoro/samples/python3.11/periodic-head.cfg new file mode 100644 index 00000000..930b1755 --- /dev/null +++ b/.kokoro/samples/python3.11/periodic-head.cfg @@ -0,0 +1,11 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-container/.kokoro/test-samples-against-head.sh" +} diff --git a/.kokoro/samples/python3.11/periodic.cfg b/.kokoro/samples/python3.11/periodic.cfg new file mode 100644 index 00000000..71cd1e59 --- /dev/null +++ b/.kokoro/samples/python3.11/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} diff --git a/.kokoro/samples/python3.11/presubmit.cfg b/.kokoro/samples/python3.11/presubmit.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/python3.11/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b9c017b3..96a8c91d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.14.0" + ".": "2.15.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a67903..1663295a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://pypi.org/project/google-cloud-container/#history +## [2.15.0](https://github.com/googleapis/python-container/compare/v2.14.0...v2.15.0) (2023-01-09) + + +### Features + +* Add EphemeralStorageLocalSsdConfig and LocalNvmeSsdBlockConfig APIs ([403c1ad](https://github.com/googleapis/python-container/commit/403c1ad328e6d052d9e6aab667bb74b8b6a559b7)) +* Add etags for cluster and node pool update operations ([403c1ad](https://github.com/googleapis/python-container/commit/403c1ad328e6d052d9e6aab667bb74b8b6a559b7)) +* Add support for specifying stack type for clusters ([403c1ad](https://github.com/googleapis/python-container/commit/403c1ad328e6d052d9e6aab667bb74b8b6a559b7)) +* Add WindowsNodeConfig field ([403c1ad](https://github.com/googleapis/python-container/commit/403c1ad328e6d052d9e6aab667bb74b8b6a559b7)) +* CLUSTER_SCOPE option now available in DNSScope ([403c1ad](https://github.com/googleapis/python-container/commit/403c1ad328e6d052d9e6aab667bb74b8b6a559b7)) +* Release GKE CloudDNS Cluster Scope ([403c1ad](https://github.com/googleapis/python-container/commit/403c1ad328e6d052d9e6aab667bb74b8b6a559b7)) + ## [2.14.0](https://github.com/googleapis/python-container/compare/v2.13.0...v2.14.0) (2022-12-15) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 4ad39c01..fd097744 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9 and 3.10 on both UNIX and Windows. + 3.7, 3.8, 3.9, 3.10 and 3.11 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -72,7 +72,7 @@ We use `nox `__ to instrument our tests. - To run a single unit test:: - $ nox -s unit-3.10 -- -k + $ nox -s unit-3.11 -- -k .. note:: @@ -225,11 +225,13 @@ We support: - `Python 3.8`_ - `Python 3.9`_ - `Python 3.10`_ +- `Python 3.11`_ .. _Python 3.7: https://docs.python.org/3.7/ .. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ +.. _Python 3.11: https://docs.python.org/3.11/ Supported versions can be found in our ``noxfile.py`` `config`_. diff --git a/google/cloud/container/__init__.py b/google/cloud/container/__init__.py index b594ebd7..a409cf10 100644 --- a/google/cloud/container/__init__.py +++ b/google/cloud/container/__init__.py @@ -55,6 +55,7 @@ DeleteNodePoolRequest, DnsCacheConfig, DNSConfig, + EphemeralStorageLocalSsdConfig, FastSocket, GatewayAPIConfig, GcePersistentDiskCsiDriverConfig, @@ -89,6 +90,7 @@ ListOperationsResponse, ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, + LocalNvmeSsdBlockConfig, LoggingComponentConfig, LoggingConfig, LoggingVariantConfig, @@ -165,6 +167,7 @@ UsableSubnetworkSecondaryRange, VerticalPodAutoscaling, VirtualNIC, + WindowsNodeConfig, WorkloadIdentityConfig, WorkloadMetadataConfig, ) @@ -201,6 +204,7 @@ "DeleteNodePoolRequest", "DnsCacheConfig", "DNSConfig", + "EphemeralStorageLocalSsdConfig", "FastSocket", "GatewayAPIConfig", "GcePersistentDiskCsiDriverConfig", @@ -234,6 +238,7 @@ "ListOperationsResponse", "ListUsableSubnetworksRequest", "ListUsableSubnetworksResponse", + "LocalNvmeSsdBlockConfig", "LoggingComponentConfig", "LoggingConfig", "LoggingVariantConfig", @@ -306,6 +311,7 @@ "UsableSubnetworkSecondaryRange", "VerticalPodAutoscaling", "VirtualNIC", + "WindowsNodeConfig", "WorkloadIdentityConfig", "WorkloadMetadataConfig", "DatapathProvider", diff --git a/google/cloud/container/gapic_version.py b/google/cloud/container/gapic_version.py index 8be00290..2788e5e5 100644 --- a/google/cloud/container/gapic_version.py +++ b/google/cloud/container/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "2.15.0" # {x-release-please-version} diff --git a/google/cloud/container_v1/__init__.py b/google/cloud/container_v1/__init__.py index 817f9c31..e4a50957 100644 --- a/google/cloud/container_v1/__init__.py +++ b/google/cloud/container_v1/__init__.py @@ -50,6 +50,7 @@ DeleteNodePoolRequest, DnsCacheConfig, DNSConfig, + EphemeralStorageLocalSsdConfig, FastSocket, GatewayAPIConfig, GcePersistentDiskCsiDriverConfig, @@ -84,6 +85,7 @@ ListOperationsResponse, ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, + LocalNvmeSsdBlockConfig, LoggingComponentConfig, LoggingConfig, LoggingVariantConfig, @@ -160,6 +162,7 @@ UsableSubnetworkSecondaryRange, VerticalPodAutoscaling, VirtualNIC, + WindowsNodeConfig, WorkloadIdentityConfig, WorkloadMetadataConfig, ) @@ -197,6 +200,7 @@ "DeleteClusterRequest", "DeleteNodePoolRequest", "DnsCacheConfig", + "EphemeralStorageLocalSsdConfig", "FastSocket", "GPUSharingConfig", "GatewayAPIConfig", @@ -231,6 +235,7 @@ "ListOperationsResponse", "ListUsableSubnetworksRequest", "ListUsableSubnetworksResponse", + "LocalNvmeSsdBlockConfig", "LoggingComponentConfig", "LoggingConfig", "LoggingVariantConfig", @@ -307,6 +312,7 @@ "UsableSubnetworkSecondaryRange", "VerticalPodAutoscaling", "VirtualNIC", + "WindowsNodeConfig", "WorkloadIdentityConfig", "WorkloadMetadataConfig", ) diff --git a/google/cloud/container_v1/gapic_version.py b/google/cloud/container_v1/gapic_version.py index 8be00290..2788e5e5 100644 --- a/google/cloud/container_v1/gapic_version.py +++ b/google/cloud/container_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "2.15.0" # {x-release-please-version} diff --git a/google/cloud/container_v1/types/__init__.py b/google/cloud/container_v1/types/__init__.py index efccf26e..7018b5f2 100644 --- a/google/cloud/container_v1/types/__init__.py +++ b/google/cloud/container_v1/types/__init__.py @@ -44,6 +44,7 @@ DeleteNodePoolRequest, DnsCacheConfig, DNSConfig, + EphemeralStorageLocalSsdConfig, FastSocket, GatewayAPIConfig, GcePersistentDiskCsiDriverConfig, @@ -78,6 +79,7 @@ ListOperationsResponse, ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, + LocalNvmeSsdBlockConfig, LoggingComponentConfig, LoggingConfig, LoggingVariantConfig, @@ -154,6 +156,7 @@ UsableSubnetworkSecondaryRange, VerticalPodAutoscaling, VirtualNIC, + WindowsNodeConfig, WorkloadIdentityConfig, WorkloadMetadataConfig, ) @@ -188,6 +191,7 @@ "DeleteNodePoolRequest", "DnsCacheConfig", "DNSConfig", + "EphemeralStorageLocalSsdConfig", "FastSocket", "GatewayAPIConfig", "GcePersistentDiskCsiDriverConfig", @@ -221,6 +225,7 @@ "ListOperationsResponse", "ListUsableSubnetworksRequest", "ListUsableSubnetworksResponse", + "LocalNvmeSsdBlockConfig", "LoggingComponentConfig", "LoggingConfig", "LoggingVariantConfig", @@ -293,6 +298,7 @@ "UsableSubnetworkSecondaryRange", "VerticalPodAutoscaling", "VirtualNIC", + "WindowsNodeConfig", "WorkloadIdentityConfig", "WorkloadMetadataConfig", "DatapathProvider", diff --git a/google/cloud/container_v1/types/cluster_service.py b/google/cloud/container_v1/types/cluster_service.py index c4547265..1446d0d1 100644 --- a/google/cloud/container_v1/types/cluster_service.py +++ b/google/cloud/container_v1/types/cluster_service.py @@ -32,6 +32,7 @@ "StackType", "IPv6AccessType", "LinuxNodeConfig", + "WindowsNodeConfig", "NodeKubeletConfig", "NodeConfig", "AdvancedMachineFeatures", @@ -167,6 +168,8 @@ "LoggingVariantConfig", "MonitoringComponentConfig", "ManagedPrometheusConfig", + "LocalNvmeSsdBlockConfig", + "EphemeralStorageLocalSsdConfig", }, ) @@ -259,6 +262,30 @@ class CgroupMode(proto.Enum): ) +class WindowsNodeConfig(proto.Message): + r"""Parameters that can be configured on Windows nodes. + Windows Node Config that define the parameters that will be used + to configure the Windows node pool settings + + Attributes: + os_version (google.cloud.container_v1.types.WindowsNodeConfig.OSVersion): + OSVersion specifies the Windows node config + to be used on the node + """ + + class OSVersion(proto.Enum): + r"""Possible OS version that can be used.""" + OS_VERSION_UNSPECIFIED = 0 + OS_VERSION_LTSC2019 = 1 + OS_VERSION_LTSC2022 = 2 + + os_version: OSVersion = proto.Field( + proto.ENUM, + number=1, + enum=OSVersion, + ) + + class NodeKubeletConfig(proto.Message): r"""Node kubelet configs. @@ -519,6 +546,16 @@ class NodeConfig(proto.Message): resources. logging_config (google.cloud.container_v1.types.NodePoolLoggingConfig): Logging configuration. + windows_node_config (google.cloud.container_v1.types.WindowsNodeConfig): + Parameters that can be configured on Windows + nodes. + local_nvme_ssd_block_config (google.cloud.container_v1.types.LocalNvmeSsdBlockConfig): + Parameters for using raw-block Local NVMe + SSDs. + ephemeral_storage_local_ssd_config (google.cloud.container_v1.types.EphemeralStorageLocalSsdConfig): + Parameters for the node ephemeral storage + using Local SSDs. If unspecified, ephemeral + storage is backed by the boot disk. """ machine_type: str = proto.Field( @@ -659,6 +696,21 @@ class NodeConfig(proto.Message): number=38, message="NodePoolLoggingConfig", ) + windows_node_config: "WindowsNodeConfig" = proto.Field( + proto.MESSAGE, + number=39, + message="WindowsNodeConfig", + ) + local_nvme_ssd_block_config: "LocalNvmeSsdBlockConfig" = proto.Field( + proto.MESSAGE, + number=40, + message="LocalNvmeSsdBlockConfig", + ) + ephemeral_storage_local_ssd_config: "EphemeralStorageLocalSsdConfig" = proto.Field( + proto.MESSAGE, + number=41, + message="EphemeralStorageLocalSsdConfig", + ) class AdvancedMachineFeatures(proto.Message): @@ -2107,6 +2159,11 @@ class Cluster(proto.Message): auto-provisioned node pools in autopilot clusters and node auto-provisioning enabled clusters. + etag (str): + This checksum is computed by the server based + on the value of cluster fields, and may be sent + on update requests to ensure the client has an + up-to-date value before proceeding. """ class Status(proto.Enum): @@ -2402,6 +2459,10 @@ class Status(proto.Enum): number=136, message="NodePoolAutoConfig", ) + etag: str = proto.Field( + proto.STRING, + number=139, + ) class NodePoolAutoConfig(proto.Message): @@ -2630,6 +2691,11 @@ class ClusterUpdate(proto.Message): desired_gateway_api_config (google.cloud.container_v1.types.GatewayAPIConfig): The desired config of Gateway API on this cluster. + etag (str): + The current etag of the cluster. + If an etag is provided and does not match the + current etag of the cluster, update will be + blocked and an ABORTED error will be returned. desired_node_pool_logging_config (google.cloud.container_v1.types.NodePoolLoggingConfig): The desired node pool logging configuration defaults for the cluster. @@ -2821,6 +2887,10 @@ class ClusterUpdate(proto.Message): number=114, message="GatewayAPIConfig", ) + etag: str = proto.Field( + proto.STRING, + number=115, + ) desired_node_pool_logging_config: "NodePoolLoggingConfig" = proto.Field( proto.MESSAGE, number=116, @@ -3298,6 +3368,11 @@ class UpdateNodePoolRequest(proto.Message): Confidential VM once enabled. gvnic (google.cloud.container_v1.types.VirtualNIC): Enable or disable gvnic on the node pool. + etag (str): + The current etag of the node pool. + If an etag is provided and does not match the + current etag of the node pool, update will be + blocked and an ABORTED error will be returned. fast_socket (google.cloud.container_v1.types.FastSocket): Enable or disable NCCL fast socket for the node pool. @@ -3307,6 +3382,9 @@ class UpdateNodePoolRequest(proto.Message): The resource labels for the node pool to use to annotate any related Google Compute Engine resources. + windows_node_config (google.cloud.container_v1.types.WindowsNodeConfig): + Parameters that can be configured on Windows + nodes. """ project_id: str = proto.Field( @@ -3396,6 +3474,10 @@ class UpdateNodePoolRequest(proto.Message): number=29, message="VirtualNIC", ) + etag: str = proto.Field( + proto.STRING, + number=30, + ) fast_socket: "FastSocket" = proto.Field( proto.MESSAGE, number=31, @@ -3411,6 +3493,11 @@ class UpdateNodePoolRequest(proto.Message): number=33, message="ResourceLabels", ) + windows_node_config: "WindowsNodeConfig" = proto.Field( + proto.MESSAGE, + number=34, + message="WindowsNodeConfig", + ) class SetNodePoolAutoscalingRequest(proto.Message): @@ -4536,6 +4623,11 @@ class NodePool(proto.Message): update_info (google.cloud.container_v1.types.NodePool.UpdateInfo): Output only. [Output only] Update info contains relevant information during a node pool update. + etag (str): + This checksum is computed by the server based + on the value of node pool fields, and may be + sent on update requests to ensure the client has + an up-to-date value before proceeding. """ class Status(proto.Enum): @@ -4818,6 +4910,10 @@ class Type(proto.Enum): number=109, message=UpdateInfo, ) + etag: str = proto.Field( + proto.STRING, + number=110, + ) class NodeManagement(proto.Message): @@ -6429,6 +6525,7 @@ class DNSScope(proto.Enum): records. """ DNS_SCOPE_UNSPECIFIED = 0 + CLUSTER_SCOPE = 1 VPC_SCOPE = 2 cluster_dns: Provider = proto.Field( @@ -7276,4 +7373,50 @@ class ManagedPrometheusConfig(proto.Message): ) +class LocalNvmeSsdBlockConfig(proto.Message): + r"""LocalNvmeSsdBlockConfig contains configuration for using + raw-block local NVMe SSD. + + Attributes: + local_ssd_count (int): + The number of raw-block local NVMe SSD disks + to be attached to the node. Each local SSD is + 375 GB in size. If zero, it means no raw-block + local NVMe 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. + """ + + local_ssd_count: int = proto.Field( + proto.INT32, + number=1, + ) + + +class EphemeralStorageLocalSsdConfig(proto.Message): + r"""EphemeralStorageLocalSsdConfig contains configuration for the + node ephemeral storage using Local SSD. + + Attributes: + local_ssd_count (int): + Number of local SSDs to use to back ephemeral + storage. Uses NVMe interfaces. Each local SSD is + 375 GB in size. If zero, it means to disable + using local SSDs as ephemeral storage. 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. + """ + + local_ssd_count: int = proto.Field( + proto.INT32, + number=1, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/container_v1beta1/__init__.py b/google/cloud/container_v1beta1/__init__.py index 1993fd79..7df69a67 100644 --- a/google/cloud/container_v1beta1/__init__.py +++ b/google/cloud/container_v1beta1/__init__.py @@ -52,6 +52,7 @@ DnsCacheConfig, DNSConfig, EphemeralStorageConfig, + EphemeralStorageLocalSsdConfig, FastSocket, GatewayAPIConfig, GcePersistentDiskCsiDriverConfig, @@ -89,6 +90,7 @@ ListOperationsResponse, ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, + LocalNvmeSsdBlockConfig, Location, LoggingComponentConfig, LoggingConfig, @@ -155,6 +157,7 @@ SetNodePoolSizeRequest, ShieldedInstanceConfig, ShieldedNodes, + StackType, StartIPRotationRequest, StatusCondition, TimeWindow, @@ -169,6 +172,7 @@ UsableSubnetworkSecondaryRange, VerticalPodAutoscaling, VirtualNIC, + WindowsNodeConfig, WindowsVersions, WorkloadALTSConfig, WorkloadCertificates, @@ -212,6 +216,7 @@ "DeleteNodePoolRequest", "DnsCacheConfig", "EphemeralStorageConfig", + "EphemeralStorageLocalSsdConfig", "FastSocket", "GPUSharingConfig", "GatewayAPIConfig", @@ -249,6 +254,7 @@ "ListOperationsResponse", "ListUsableSubnetworksRequest", "ListUsableSubnetworksResponse", + "LocalNvmeSsdBlockConfig", "Location", "LoggingComponentConfig", "LoggingConfig", @@ -315,6 +321,7 @@ "SetNodePoolSizeRequest", "ShieldedInstanceConfig", "ShieldedNodes", + "StackType", "StartIPRotationRequest", "StatusCondition", "TimeWindow", @@ -329,6 +336,7 @@ "UsableSubnetworkSecondaryRange", "VerticalPodAutoscaling", "VirtualNIC", + "WindowsNodeConfig", "WindowsVersions", "WorkloadALTSConfig", "WorkloadCertificates", diff --git a/google/cloud/container_v1beta1/gapic_version.py b/google/cloud/container_v1beta1/gapic_version.py index 8be00290..2788e5e5 100644 --- a/google/cloud/container_v1beta1/gapic_version.py +++ b/google/cloud/container_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.14.0" # {x-release-please-version} +__version__ = "2.15.0" # {x-release-please-version} diff --git a/google/cloud/container_v1beta1/types/__init__.py b/google/cloud/container_v1beta1/types/__init__.py index c13a4196..247e6211 100644 --- a/google/cloud/container_v1beta1/types/__init__.py +++ b/google/cloud/container_v1beta1/types/__init__.py @@ -46,6 +46,7 @@ DnsCacheConfig, DNSConfig, EphemeralStorageConfig, + EphemeralStorageLocalSsdConfig, FastSocket, GatewayAPIConfig, GcePersistentDiskCsiDriverConfig, @@ -83,6 +84,7 @@ ListOperationsResponse, ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, + LocalNvmeSsdBlockConfig, Location, LoggingComponentConfig, LoggingConfig, @@ -149,6 +151,7 @@ SetNodePoolSizeRequest, ShieldedInstanceConfig, ShieldedNodes, + StackType, StartIPRotationRequest, StatusCondition, TimeWindow, @@ -163,6 +166,7 @@ UsableSubnetworkSecondaryRange, VerticalPodAutoscaling, VirtualNIC, + WindowsNodeConfig, WindowsVersions, WorkloadALTSConfig, WorkloadCertificates, @@ -203,6 +207,7 @@ "DnsCacheConfig", "DNSConfig", "EphemeralStorageConfig", + "EphemeralStorageLocalSsdConfig", "FastSocket", "GatewayAPIConfig", "GcePersistentDiskCsiDriverConfig", @@ -240,6 +245,7 @@ "ListOperationsResponse", "ListUsableSubnetworksRequest", "ListUsableSubnetworksResponse", + "LocalNvmeSsdBlockConfig", "Location", "LoggingComponentConfig", "LoggingConfig", @@ -317,6 +323,7 @@ "UsableSubnetworkSecondaryRange", "VerticalPodAutoscaling", "VirtualNIC", + "WindowsNodeConfig", "WindowsVersions", "WorkloadALTSConfig", "WorkloadCertificates", @@ -326,5 +333,6 @@ "DatapathProvider", "NodePoolUpdateStrategy", "PrivateIPv6GoogleAccess", + "StackType", "UpgradeResourceType", ) diff --git a/google/cloud/container_v1beta1/types/cluster_service.py b/google/cloud/container_v1beta1/types/cluster_service.py index 6141a6a7..d0656135 100644 --- a/google/cloud/container_v1beta1/types/cluster_service.py +++ b/google/cloud/container_v1beta1/types/cluster_service.py @@ -30,7 +30,9 @@ "UpgradeResourceType", "NodePoolUpdateStrategy", "DatapathProvider", + "StackType", "LinuxNodeConfig", + "WindowsNodeConfig", "NodeKubeletConfig", "NodeConfig", "AdvancedMachineFeatures", @@ -38,6 +40,8 @@ "ShieldedInstanceConfig", "SandboxConfig", "EphemeralStorageConfig", + "LocalNvmeSsdBlockConfig", + "EphemeralStorageLocalSsdConfig", "GcfsConfig", "ReservationAffinity", "NodeTaint", @@ -221,6 +225,13 @@ class DatapathProvider(proto.Enum): ADVANCED_DATAPATH = 2 +class StackType(proto.Enum): + r"""Possible values for IP stack type""" + STACK_TYPE_UNSPECIFIED = 0 + IPV4 = 1 + IPV4_IPV6 = 2 + + class LinuxNodeConfig(proto.Message): r"""Parameters that can be configured on Linux nodes. @@ -259,6 +270,30 @@ class CgroupMode(proto.Enum): ) +class WindowsNodeConfig(proto.Message): + r"""Parameters that can be configured on Windows nodes. + Windows Node Config that define the parameters that will be used + to configure the Windows node pool settings + + Attributes: + os_version (google.cloud.container_v1beta1.types.WindowsNodeConfig.OSVersion): + OSVersion specifies the Windows node config + to be used on the node + """ + + class OSVersion(proto.Enum): + r"""Possible OS version that can be used.""" + OS_VERSION_UNSPECIFIED = 0 + OS_VERSION_LTSC2019 = 1 + OS_VERSION_LTSC2022 = 2 + + os_version: OSVersion = proto.Field( + proto.ENUM, + number=1, + enum=OSVersion, + ) + + class NodeKubeletConfig(proto.Message): r"""Node kubelet configs. @@ -522,6 +557,17 @@ class NodeConfig(proto.Message): resources. logging_config (google.cloud.container_v1beta1.types.NodePoolLoggingConfig): Logging configuration. + windows_node_config (google.cloud.container_v1beta1.types.WindowsNodeConfig): + Parameters that can be configured on Windows + nodes. + local_nvme_ssd_block_config (google.cloud.container_v1beta1.types.LocalNvmeSsdBlockConfig): + Parameters for using raw-block Local NVMe + SSDs. + ephemeral_storage_local_ssd_config (google.cloud.container_v1beta1.types.EphemeralStorageLocalSsdConfig): + Parameters for the node ephemeral storage using Local SSDs. + If unspecified, ephemeral storage is backed by the boot + disk. This field is functionally equivalent to the + ephemeral_storage_config """ machine_type: str = proto.Field( @@ -667,6 +713,21 @@ class NodeConfig(proto.Message): number=38, message="NodePoolLoggingConfig", ) + windows_node_config: "WindowsNodeConfig" = proto.Field( + proto.MESSAGE, + number=39, + message="WindowsNodeConfig", + ) + local_nvme_ssd_block_config: "LocalNvmeSsdBlockConfig" = proto.Field( + proto.MESSAGE, + number=40, + message="LocalNvmeSsdBlockConfig", + ) + ephemeral_storage_local_ssd_config: "EphemeralStorageLocalSsdConfig" = proto.Field( + proto.MESSAGE, + number=41, + message="EphemeralStorageLocalSsdConfig", + ) class AdvancedMachineFeatures(proto.Message): @@ -891,6 +952,52 @@ class EphemeralStorageConfig(proto.Message): ) +class LocalNvmeSsdBlockConfig(proto.Message): + r"""LocalNvmeSsdBlockConfig contains configuration for using + raw-block local NVMe SSDs + + Attributes: + local_ssd_count (int): + The number of raw-block local NVMe SSD disks + to be attached to the node. Each local SSD is + 375 GB in size. If zero, it means no raw-block + local NVMe 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. + """ + + local_ssd_count: int = proto.Field( + proto.INT32, + number=1, + ) + + +class EphemeralStorageLocalSsdConfig(proto.Message): + r"""EphemeralStorageLocalSsdConfig contains configuration for the + node ephemeral storage using Local SSDs. + + Attributes: + local_ssd_count (int): + Number of local SSDs to use to back ephemeral + storage. Uses NVMe interfaces. Each local SSD is + 375 GB in size. If zero, it means to disable + using local SSDs as ephemeral storage. 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. + """ + + local_ssd_count: int = proto.Field( + proto.INT32, + number=1, + ) + + class GcfsConfig(proto.Message): r"""GcfsConfig contains configurations of Google Container File System. @@ -2992,6 +3099,12 @@ class ClusterUpdate(proto.Message): desired_node_pool_logging_config (google.cloud.container_v1beta1.types.NodePoolLoggingConfig): The desired node pool logging configuration defaults for the cluster. + desired_stack_type (google.cloud.container_v1beta1.types.StackType): + The desired stack type of the cluster. + If a stack type is provided and does not match + the current stack type of the cluster, update + will attempt to change the stack type to the new + type. """ desired_node_version: str = proto.Field( @@ -3215,6 +3328,11 @@ class ClusterUpdate(proto.Message): number=116, message="NodePoolLoggingConfig", ) + desired_stack_type: "StackType" = proto.Field( + proto.ENUM, + number=119, + enum="StackType", + ) class Operation(proto.Message): @@ -3690,6 +3808,9 @@ class UpdateNodePoolRequest(proto.Message): The resource labels for the node pool to use to annotate any related Google Compute Engine resources. + windows_node_config (google.cloud.container_v1beta1.types.WindowsNodeConfig): + Parameters that can be configured on Windows + nodes. """ project_id: str = proto.Field( @@ -3794,6 +3915,11 @@ class UpdateNodePoolRequest(proto.Message): number=33, message="ResourceLabels", ) + windows_node_config: "WindowsNodeConfig" = proto.Field( + proto.MESSAGE, + number=34, + message="WindowsNodeConfig", + ) class SetNodePoolAutoscalingRequest(proto.Message): diff --git a/noxfile.py b/noxfile.py index d8440c02..e716318b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -32,7 +32,7 @@ DEFAULT_PYTHON_VERSION = "3.8" -UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] +UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", diff --git a/samples/generated_samples/snippet_metadata_google.container.v1.json b/samples/generated_samples/snippet_metadata_google.container.v1.json index 9ab16eb0..db5d85de 100644 --- a/samples/generated_samples/snippet_metadata_google.container.v1.json +++ b/samples/generated_samples/snippet_metadata_google.container.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-container", - "version": "2.14.0" + "version": "2.15.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.container.v1beta1.json b/samples/generated_samples/snippet_metadata_google.container.v1beta1.json index e6078800..69b77990 100644 --- a/samples/generated_samples/snippet_metadata_google.container.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.container.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-container", - "version": "2.14.0" + "version": "2.15.0" }, "snippets": [ { diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 05770846..de104dbc 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -88,7 +88,7 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. # All versions used to test samples. -ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"] +ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 801bc8b4..25d87519 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,3 +1,3 @@ -google-cloud-container==2.13.0 +google-cloud-container==2.14.0 backoff==2.2.1 pytest==7.2.0 \ No newline at end of file diff --git a/scripts/fixup_container_v1_keywords.py b/scripts/fixup_container_v1_keywords.py index 854df513..80b16377 100644 --- a/scripts/fixup_container_v1_keywords.py +++ b/scripts/fixup_container_v1_keywords.py @@ -71,7 +71,7 @@ class containerCallTransformer(cst.CSTTransformer): 'start_ip_rotation': ('project_id', 'zone', 'cluster_id', 'name', 'rotate_credentials', ), 'update_cluster': ('update', 'project_id', 'zone', 'cluster_id', 'name', ), 'update_master': ('master_version', 'project_id', 'zone', 'cluster_id', 'name', ), - 'update_node_pool': ('node_version', 'image_type', 'project_id', 'zone', 'cluster_id', 'node_pool_id', 'name', 'locations', 'workload_metadata_config', 'upgrade_settings', 'tags', 'taints', 'labels', 'linux_node_config', 'kubelet_config', 'node_network_config', 'gcfs_config', 'confidential_nodes', 'gvnic', 'fast_socket', 'logging_config', 'resource_labels', ), + 'update_node_pool': ('node_version', 'image_type', 'project_id', 'zone', 'cluster_id', 'node_pool_id', 'name', 'locations', 'workload_metadata_config', 'upgrade_settings', 'tags', 'taints', 'labels', 'linux_node_config', 'kubelet_config', 'node_network_config', 'gcfs_config', 'confidential_nodes', 'gvnic', 'etag', 'fast_socket', 'logging_config', 'resource_labels', 'windows_node_config', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: diff --git a/scripts/fixup_container_v1beta1_keywords.py b/scripts/fixup_container_v1beta1_keywords.py index 34053f77..6bb191d0 100644 --- a/scripts/fixup_container_v1beta1_keywords.py +++ b/scripts/fixup_container_v1beta1_keywords.py @@ -72,7 +72,7 @@ class containerCallTransformer(cst.CSTTransformer): 'start_ip_rotation': ('project_id', 'zone', 'cluster_id', 'name', 'rotate_credentials', ), 'update_cluster': ('project_id', 'zone', 'cluster_id', 'update', 'name', ), 'update_master': ('project_id', 'zone', 'cluster_id', 'master_version', 'name', ), - 'update_node_pool': ('project_id', 'zone', 'cluster_id', 'node_pool_id', 'node_version', 'image_type', 'locations', 'workload_metadata_config', 'name', 'upgrade_settings', 'tags', 'taints', 'labels', 'linux_node_config', 'kubelet_config', 'node_network_config', 'gcfs_config', 'confidential_nodes', 'gvnic', 'fast_socket', 'logging_config', 'resource_labels', ), + 'update_node_pool': ('project_id', 'zone', 'cluster_id', 'node_pool_id', 'node_version', 'image_type', 'locations', 'workload_metadata_config', 'name', 'upgrade_settings', 'tags', 'taints', 'labels', 'linux_node_config', 'kubelet_config', 'node_network_config', 'gcfs_config', 'confidential_nodes', 'gvnic', 'fast_socket', 'logging_config', 'resource_labels', 'windows_node_config', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: diff --git a/tests/unit/gapic/container_v1/test_cluster_manager.py b/tests/unit/gapic/container_v1/test_cluster_manager.py index faedea20..fce41dee 100644 --- a/tests/unit/gapic/container_v1/test_cluster_manager.py +++ b/tests/unit/gapic/container_v1/test_cluster_manager.py @@ -987,6 +987,7 @@ def test_get_cluster(request_type, transport: str = "grpc"): enable_tpu=True, tpu_ipv4_cidr_block="tpu_ipv4_cidr_block_value", id="id_value", + etag="etag_value", ) response = client.get_cluster(request) @@ -1026,6 +1027,7 @@ def test_get_cluster(request_type, transport: str = "grpc"): assert response.enable_tpu is True assert response.tpu_ipv4_cidr_block == "tpu_ipv4_cidr_block_value" assert response.id == "id_value" + assert response.etag == "etag_value" def test_get_cluster_empty_call(): @@ -1091,6 +1093,7 @@ async def test_get_cluster_async( enable_tpu=True, tpu_ipv4_cidr_block="tpu_ipv4_cidr_block_value", id="id_value", + etag="etag_value", ) ) response = await client.get_cluster(request) @@ -1131,6 +1134,7 @@ async def test_get_cluster_async( assert response.enable_tpu is True assert response.tpu_ipv4_cidr_block == "tpu_ipv4_cidr_block_value" assert response.id == "id_value" + assert response.etag == "etag_value" @pytest.mark.asyncio @@ -5952,6 +5956,7 @@ def test_get_node_pool(request_type, transport: str = "grpc"): status=cluster_service.NodePool.Status.PROVISIONING, status_message="status_message_value", pod_ipv4_cidr_size=1856, + etag="etag_value", ) response = client.get_node_pool(request) @@ -5971,6 +5976,7 @@ def test_get_node_pool(request_type, transport: str = "grpc"): assert response.status == cluster_service.NodePool.Status.PROVISIONING assert response.status_message == "status_message_value" assert response.pod_ipv4_cidr_size == 1856 + assert response.etag == "etag_value" def test_get_node_pool_empty_call(): @@ -6016,6 +6022,7 @@ async def test_get_node_pool_async( status=cluster_service.NodePool.Status.PROVISIONING, status_message="status_message_value", pod_ipv4_cidr_size=1856, + etag="etag_value", ) ) response = await client.get_node_pool(request) @@ -6036,6 +6043,7 @@ async def test_get_node_pool_async( assert response.status == cluster_service.NodePool.Status.PROVISIONING assert response.status_message == "status_message_value" assert response.pod_ipv4_cidr_size == 1856 + assert response.etag == "etag_value" @pytest.mark.asyncio