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

products/container: Add datapath provider field #447

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/resources/google_container_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/resources/google_container_clusters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_container_cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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']
Expand Down
2 changes: 2 additions & 0 deletions libraries/google_container_clusters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'] },
Expand Down