Skip to content

Commit

Permalink
Merge pull request #163 from OpenSLO/feature/threshold-metrics
Browse files Browse the repository at this point in the history
default operator
  • Loading branch information
ian-bartholomew authored Sep 29, 2022
2 parents 27f7c4a + 31d3c3c commit 4710d14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/pkg/convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,13 @@ func getN9Thresholds(o []v1.Objective, indicator v1.SLISpec) ([]nobl9v1alpha.Thr
var t []nobl9v1alpha.Threshold //nolint:prealloc
for _, v := range o {
v := v // local copy
// if the operator isn't nil, then assign it, otherwise keep it nil
// if the operator isn't nil, then assign it, otherwise use default
var operator *string
defaultOp := "lt"
if v.Op != "" {
operator = &v.Op
} else {
operator = &defaultOp
}

// if v.Value is set use that, otherwise default to 1
Expand Down

0 comments on commit 4710d14

Please sign in to comment.