Skip to content

Commit 723d418

Browse files
authored
initial fix (#11500)
1 parent bbf4d6c commit 723d418

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

mmv1/third_party/terraform/services/container/go/node_config.go.tmpl

+8
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,10 @@ func expandNodeConfig(v interface{}) *container.NodeConfig {
11031103
}
11041104

11051105
func expandResourceManagerTags(v interface{}) *container.ResourceManagerTags {
1106+
if v == nil {
1107+
return nil
1108+
}
1109+
11061110
rmts := make(map[string]string)
11071111

11081112
if v != nil {
@@ -1442,6 +1446,10 @@ func flattenNodeConfig(c *container.NodeConfig, v interface{}) []map[string]inte
14421446
}
14431447

14441448
func flattenResourceManagerTags(c *container.ResourceManagerTags) map[string]interface{} {
1449+
if c == nil {
1450+
return nil
1451+
}
1452+
14451453
rmt := make(map[string]interface{})
14461454

14471455
if c != nil {

mmv1/third_party/terraform/services/container/go/resource_container_cluster.go.tmpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -5667,10 +5667,11 @@ func flattenNodePoolDefaults(c *container.NodePoolDefaults) []map[string]interfa
56675667
}
56685668

56695669
func expandNodePoolAutoConfig(configured interface{}) *container.NodePoolAutoConfig {
5670-
l := configured.([]interface{})
5671-
if len(l) == 0 || l[0] == nil {
5670+
l, ok := configured.([]interface{})
5671+
if !ok || l == nil || len(l) == 0 || l[0] == nil {
56725672
return nil
56735673
}
5674+
56745675
npac := &container.NodePoolAutoConfig{}
56755676
config := l[0].(map[string]interface{})
56765677

mmv1/third_party/terraform/services/container/node_config.go.erb

+8
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,10 @@ func expandNodeConfig(v interface{}) *container.NodeConfig {
10991099
}
11001100

11011101
func expandResourceManagerTags(v interface{}) *container.ResourceManagerTags {
1102+
if v == nil {
1103+
return nil
1104+
}
1105+
11021106
rmts := make(map[string]string)
11031107

11041108
if v != nil {
@@ -1438,6 +1442,10 @@ func flattenNodeConfig(c *container.NodeConfig, v interface{}) []map[string]inte
14381442
}
14391443

14401444
func flattenResourceManagerTags(c *container.ResourceManagerTags) map[string]interface{} {
1445+
if c == nil {
1446+
return nil
1447+
}
1448+
14411449
rmt := make(map[string]interface{})
14421450

14431451
if c != nil {

mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb

+3-2
Original file line numberDiff line numberDiff line change
@@ -5664,10 +5664,11 @@ func flattenNodePoolDefaults(c *container.NodePoolDefaults) []map[string]interfa
56645664
}
56655665

56665666
func expandNodePoolAutoConfig(configured interface{}) *container.NodePoolAutoConfig {
5667-
l := configured.([]interface{})
5668-
if len(l) == 0 || l[0] == nil {
5667+
l, ok := configured.([]interface{})
5668+
if !ok || l == nil || len(l) == 0 || l[0] == nil {
56695669
return nil
56705670
}
5671+
56715672
npac := &container.NodePoolAutoConfig{}
56725673
config := l[0].(map[string]interface{})
56735674

0 commit comments

Comments
 (0)