Skip to content

Commit ce1aaab

Browse files
committed
SUMO-213711 minor refactor
1 parent d5c3e2b commit ce1aaab

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

sumologic/resource_sumologic_monitors_library_monitor.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,9 +1395,6 @@ func jsonToSloBurnRateConditionBlock(conditions []TriggerCondition) map[string]i
13951395
var criticalAlrt, warningAlrt = dict{}, dict{}
13961396
block := map[string]interface{}{}
13971397

1398-
block["critical"] = toSingletonArray(criticalAlrt)
1399-
block["warning"] = toSingletonArray(warningAlrt)
1400-
14011398
var hasCritical, hasWarning = false, false
14021399
for _, condition := range conditions {
14031400
switch condition.TriggerType {
@@ -1409,6 +1406,10 @@ func jsonToSloBurnRateConditionBlock(conditions []TriggerCondition) map[string]i
14091406
warningAlrt = getAlertBlock(condition)
14101407
}
14111408
}
1409+
1410+
block["critical"] = toSingletonArray(criticalAlrt)
1411+
block["warning"] = toSingletonArray(warningAlrt)
1412+
14121413
if !hasCritical {
14131414
delete(block, "critical")
14141415
}

sumologic/sumologic_monitors_library_monitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ type MonitorQuery struct {
157157
}
158158

159159
type TriggerCondition struct {
160-
TimeRange string `json:"timeRange"`
160+
TimeRange string `json:"timeRange,omitempty"`
161161
TriggerType string `json:"triggerType"`
162162
Threshold float64 `json:"threshold,omitempty"`
163163
ThresholdType string `json:"thresholdType,omitempty"`

0 commit comments

Comments
 (0)