Skip to content

Commit

Permalink
fix: overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
celaus committed Nov 14, 2024
1 parent 3cec3ba commit e005a65
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions coralogix/resource_coralogix_alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -2359,6 +2359,9 @@ func extractRatioRules(ctx context.Context, elements types.List) ([]*cxsdk.LogsR
TimeWindow: timeWindow,
ConditionType: logsRatioConditionSchemaToProtoMap[rule.Condition.ValueString()],
},
Override: &cxsdk.AlertDefPriorityOverride{
Priority: alertPrioritySchemaToProtoMap[rule.Override.ValueString()],
},
}
}
if diags.HasError() {
Expand Down Expand Up @@ -2657,6 +2660,9 @@ func extractMetricThresholdRules(ctx context.Context, elements types.List) ([]*c
OfTheLast: ofTheLast,
ConditionType: metricsThresholdConditionToProtoMap[rule.Condition.ValueString()],
},
Override: &cxsdk.AlertDefPriorityOverride{
Priority: alertPrioritySchemaToProtoMap[rule.Override.ValueString()],
},
}
}
if diags.HasError() {
Expand Down Expand Up @@ -3614,6 +3620,7 @@ func flattenLogsRatioThreshold(ctx context.Context, ratioThreshold *cxsdk.LogsRa
Threshold: wrapperspbDoubleToTypeFloat64(rule.Condition.GetThreshold()),
TimeWindow: timeWindow,
Condition: types.StringValue(logsRatioConditionMap[rule.Condition.GetConditionType()]),
Override: types.StringValue(alertPriorityProtoToSchemaMap[rule.Override.Priority]),
}
}

Expand Down Expand Up @@ -3779,6 +3786,7 @@ func flattenLogsTimeRelativeThreshold(ctx context.Context, logsTimeRelativeThres
Threshold: wrapperspbDoubleToTypeFloat64(rule.Condition.GetThreshold()),
ComparedTo: types.StringValue(logsTimeRelativeComparedToProtoToSchemaMap[rule.Condition.ComparedTo]),
Condition: types.StringValue(logsTimeRelativeConditionMap[rule.Condition.ConditionType]),
Override: types.StringValue(alertPriorityProtoToSchemaMap[rule.Override.Priority]),
}
}

Expand Down

0 comments on commit e005a65

Please sign in to comment.