Skip to content

Commit 30623b1

Browse files
authored
tgc-revival: Fix node pool tests (GoogleCloudPlatform#17389)
1 parent f0eabf2 commit 30623b1

5 files changed

Lines changed: 16 additions & 0 deletions

File tree

mmv1/products/compute/ServiceAttachment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ properties:
280280
An array of projects that are not allowed to connect to this service
281281
attachment.
282282
send_empty_value: true
283+
is_missing_in_cai: true # Ignored in TGC tests due to timing issues in CAI updates where the field disappears in intermediate steps.
283284
item_type:
284285
type: String
285286
- name: 'consumerAcceptLists'

mmv1/products/container/NodePool.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ properties:
9999
type: 'Boolean'
100100
description: 'Whether to create a new range for pod IPs in this node pool.'
101101
ignore_read: true
102+
- name: 'acceleratorNetworkProfile'
103+
type: 'String'
104+
description: 'Accelerator network profile for this NodePool.'
105+
is_missing_in_cai: true

mmv1/third_party/tgc_next/pkg/services/container/resource_container_node_pool.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ var schemaNodePool = map[string]*schema.Schema{
317317
Computed: true,
318318
Description: `Whether nodes have internal IP addresses only.`,
319319
},
320+
"accelerator_network_profile": {
321+
Type: schema.TypeString,
322+
Optional: true,
323+
ForceNew: true,
324+
Description: `The accelerator network profile for the node pool.`,
325+
},
320326
"pod_range": {
321327
Type: schema.TypeString,
322328
Optional: true,

mmv1/third_party/tgc_next/pkg/services/container/resource_node_pool_cai2hcl.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ func flattenNodeNetworkConfig(c interface{}, d *schema.ResourceData, prefix stri
265265
"network_performance_config": flattenNodeNetworkPerformanceConfig(config["networkPerformanceConfig"]),
266266
"additional_node_network_configs": flattenAdditionalNodeNetworkConfig(config["additionalNodeNetworkConfigs"]),
267267
"additional_pod_network_configs": flattenAdditionalPodNetworkConfig(config["additionalPodNetworkConfigs"]),
268+
"accelerator_network_profile": config["acceleratorNetworkProfile"],
268269
}
269270

270271
// enable_private_nodes = false and the field not in HCL behaves the same, as this field is in ForceSendFields and the false value is included in the API request when it is not specified in config.

mmv1/third_party/tgc_next/pkg/services/container/resource_node_pool_tfplan2cai.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,10 @@ func expandNodeNetworkConfig(v interface{}) *container.NodeNetworkConfig {
636636
nnc.ForceSendFields = []string{"EnablePrivateNodes"}
637637
}
638638

639+
if v, ok := networkNodeConfig["accelerator_network_profile"]; ok {
640+
nnc.AcceleratorNetworkProfile = v.(string)
641+
}
642+
639643
if v, ok := networkNodeConfig["additional_node_network_configs"]; ok && len(v.([]interface{})) > 0 {
640644
node_network_configs := v.([]interface{})
641645
nodeNetworkConfigs := make([]*container.AdditionalNodeNetworkConfig, 0, len(node_network_configs))

0 commit comments

Comments
 (0)