Skip to content

Commit 973e6c2

Browse files
committed
Some minor fixes
1. Rename layout_structures to layout_structure to be consistent with naming scheme 2. Fix type conversion bug
1 parent 5753195 commit 973e6c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sumologic/resource_sumologic_dashboard.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func getLayoutSchema() map[string]*schema.Schema {
408408

409409
func getGridLayoutSchema() map[string]*schema.Schema {
410410
return map[string]*schema.Schema{
411-
"layout_structures": {
411+
"layout_structure": {
412412
Type: schema.TypeList,
413413
Required: true,
414414
Elem: &schema.Resource{
@@ -1009,7 +1009,7 @@ func getTimeRangeBoundary(tfRangeBoundary map[string]interface{}) interface{} {
10091009
if epochBoundary, ok := val[0].(map[string](interface{})); ok {
10101010
return EpochTimeRangeBoundary{
10111011
Type: "EpochTimeRangeBoundary",
1012-
EpochMillis: epochBoundary["epoch_millis"].(int64),
1012+
EpochMillis: int64(epochBoundary["epoch_millis"].(int)),
10131013
}
10141014
}
10151015
} else if val := tfRangeBoundary["iso8601_time_range"].([]interface{}); len(val) == 1 {
@@ -1055,7 +1055,7 @@ func getTopologyLabel(tfTopologyLabel map[string]interface{}) *TopologyLabel {
10551055
func getLayout(tfLayout map[string]interface{}) interface{} {
10561056
if val := tfLayout["grid"].([]interface{}); len(val) == 1 {
10571057
if gridLayout, ok := val[0].(map[string]interface{}); ok {
1058-
if tfStructures, ok := gridLayout["layout_structures"].([]interface{}); ok {
1058+
if tfStructures, ok := gridLayout["layout_structure"].([]interface{}); ok {
10591059
var structures []LayoutStructure
10601060
for _, v := range tfStructures {
10611061
if tfStructure, ok := v.(map[string]interface{}); ok {
@@ -1441,7 +1441,7 @@ func getTerraformLayout(layout map[string]interface{}) TerraformObject {
14411441
for i, structure := range layoutStructures {
14421442
tfLayoutStructures[i] = structure.(map[string]interface{})
14431443
}
1444-
gridLayout[0]["layout_structures"] = tfLayoutStructures
1444+
gridLayout[0]["layout_structure"] = tfLayoutStructures
14451445
tfLayout[0]["grid"] = gridLayout
14461446
}
14471447

0 commit comments

Comments
 (0)