From bd8f708c17b6cb2813eb0956a6e5322a9af23a15 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Wed, 16 Sep 2020 18:10:10 +0000 Subject: [PATCH] products/container: Add datapath provider field (#3956) Signed-off-by: Modular Magician --- docs/resources/google_container_cluster.md | 6 ++++++ docs/resources/google_container_clusters.md | 1 + libraries/google_container_cluster.rb | 2 ++ libraries/google_container_clusters.rb | 2 ++ 4 files changed, 11 insertions(+) diff --git a/docs/resources/google_container_cluster.md b/docs/resources/google_container_cluster.md index 8f20bfca2..bf861a90d 100644 --- a/docs/resources/google_container_cluster.md +++ b/docs/resources/google_container_cluster.md @@ -192,6 +192,12 @@ Properties that can be accessed from the `google_container_cluster` resource: * `subnetwork`: The name of the Google Compute Engine subnetwork to which the cluster is connected. + * `datapath_provider`: (Beta only) The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation. + Possible values: + * DATAPATH_PROVIDER_UNSPECIFIED + * LEGACY_DATAPATH + * ADVANCED_DATAPATH + * `locations`: The list of Google Compute Engine zones in which the cluster's nodes should be located. * `resource_labels`: The resource labels for the cluster to use to annotate any related Google Compute Engine resources. diff --git a/docs/resources/google_container_clusters.md b/docs/resources/google_container_clusters.md index 4f12ee872..43cc81413 100644 --- a/docs/resources/google_container_clusters.md +++ b/docs/resources/google_container_clusters.md @@ -62,6 +62,7 @@ See [google_container_cluster.md](google_container_cluster.md) for more detailed * `tpu_ipv4_cidr_blocks`: an array of `google_container_cluster` tpu_ipv4_cidr_block * `addons_configs`: an array of `google_container_cluster` addons_config * `subnetworks`: an array of `google_container_cluster` subnetwork + * `datapath_providers`: (Beta only) an array of `google_container_cluster` datapath_provider * `locations`: an array of `google_container_cluster` locations * `resource_labels`: an array of `google_container_cluster` resource_labels * `label_fingerprints`: an array of `google_container_cluster` label_fingerprint diff --git a/libraries/google_container_cluster.rb b/libraries/google_container_cluster.rb index a1d4045f8..338954139 100644 --- a/libraries/google_container_cluster.rb +++ b/libraries/google_container_cluster.rb @@ -59,6 +59,7 @@ class ContainerCluster < GcpResourceBase attr_reader :tpu_ipv4_cidr_block attr_reader :addons_config attr_reader :subnetwork + attr_reader :datapath_provider attr_reader :locations attr_reader :resource_labels attr_reader :label_fingerprint @@ -107,6 +108,7 @@ def parse @tpu_ipv4_cidr_block = @fetched['tpuIpv4CidrBlock'] @addons_config = GoogleInSpec::Container::Property::ClusterAddonsConfig.new(@fetched['addonsConfig'], to_s) @subnetwork = @fetched['subnetwork'] + @datapath_provider = @fetched['datapathProvider'] @locations = @fetched['locations'] @resource_labels = @fetched['resourceLabels'] @label_fingerprint = @fetched['labelFingerprint'] diff --git a/libraries/google_container_clusters.rb b/libraries/google_container_clusters.rb index ee1e9f271..c419950ea 100644 --- a/libraries/google_container_clusters.rb +++ b/libraries/google_container_clusters.rb @@ -37,6 +37,7 @@ class ContainerClusters < GcpResourceBase filter_table_config.add(:tpu_ipv4_cidr_blocks, field: :tpu_ipv4_cidr_block) filter_table_config.add(:addons_configs, field: :addons_config) filter_table_config.add(:subnetworks, field: :subnetwork) + filter_table_config.add(:datapath_providers, field: :datapath_provider) filter_table_config.add(:locations, field: :locations) filter_table_config.add(:resource_labels, field: :resource_labels) filter_table_config.add(:label_fingerprints, field: :label_fingerprint) @@ -115,6 +116,7 @@ def transformers 'tpuIpv4CidrBlock' => ->(obj) { return :tpu_ipv4_cidr_block, obj['tpuIpv4CidrBlock'] }, 'addonsConfig' => ->(obj) { return :addons_config, GoogleInSpec::Container::Property::ClusterAddonsConfig.new(obj['addonsConfig'], to_s) }, 'subnetwork' => ->(obj) { return :subnetwork, obj['subnetwork'] }, + 'datapathProvider' => ->(obj) { return :datapath_provider, obj['datapathProvider'] }, 'locations' => ->(obj) { return :locations, obj['locations'] }, 'resourceLabels' => ->(obj) { return :resource_labels, obj['resourceLabels'] }, 'labelFingerprint' => ->(obj) { return :label_fingerprint, obj['labelFingerprint'] },