Skip to content

Commit

Permalink
fix(google_container_node_pool): panic interface conversion on `addit…
Browse files Browse the repository at this point in the history
…ional_pod_network_configs` (#8820) (#6211)

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Sep 6, 2023
1 parent ecd0890 commit 88d1303
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changelog/8820.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
container: fix a bug where `additional_pod_network_configs` was not sent correctly in `google_container_node_pool`
```
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,10 @@ func expandNodeNetworkConfig(v interface{}) *container.NodeNetworkConfig {
for _, raw := range pod_network_configs {
data := raw.(map[string]interface{})
podnetworkConfig := &container.AdditionalPodNetworkConfig{
Subnetwork: data["network"].(string),
SecondaryPodRange: data["subnetwork"].(string),
Subnetwork: data["subnetwork"].(string),
SecondaryPodRange: data["secondary_pod_range"].(string),
MaxPodsPerNode: &container.MaxPodsConstraint{
MaxPodsPerNode: data["max_pods_per_node"].(int64),
MaxPodsPerNode: int64(data["max_pods_per_node"].(int)),
},
}
podNetworkConfigs = append(podNetworkConfigs, podnetworkConfig)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2734,6 +2734,11 @@ resource "google_compute_subnetwork" "subnet2" {
network = google_compute_network.addn_net_2.name
ip_cidr_range = "10.0.38.0/24"
region = "us-central1"
secondary_ip_range {
range_name = "pod"
ip_cidr_range = "10.0.64.0/19"
}
}
resource "google_container_cluster" "cluster" {
Expand Down Expand Up @@ -2767,13 +2772,18 @@ resource "google_container_node_pool" "with_multi_nic" {
create_pod_range = false
enable_private_nodes = true
pod_range = google_compute_subnetwork.container_subnetwork.secondary_ip_range[0].range_name
additional_node_network_configs {
network = google_compute_network.addn_net_1.name
additional_node_network_configs {
network = google_compute_network.addn_net_1.name
subnetwork = google_compute_subnetwork.subnet1.name
}
additional_node_network_configs {
network = google_compute_network.addn_net_2.name
subnetwork = google_compute_subnetwork.subnet2.name
network = google_compute_network.addn_net_2.name
subnetwork = google_compute_subnetwork.subnet2.name
}
additional_pod_network_configs {
subnetwork = google_compute_subnetwork.subnet2.name
secondary_pod_range = "pod"
max_pods_per_node = 32
}
}
node_config {
Expand Down

0 comments on commit 88d1303

Please sign in to comment.