Skip to content

Commit 6bf8659

Browse files
Luke Atkinsonmetalmatze
Luke Atkinson
authored andcommitted
Fix invalid PrometheusRule when adding grouping to a ratio indicator
1 parent 83b0b8b commit 6bf8659

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kubernetes/controllers/servicelevelobjective.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ func makeConfigMap(name string, kubeObjective pyrrav1alpha1.ServiceLevelObjectiv
180180
return nil, fmt.Errorf("failed to get generic rules: %w", err)
181181
}
182182
// ignore these rules
183+
} else {
184+
rule.Groups = append(rule.Groups, rules)
183185
}
184-
185-
rule.Groups = append(rule.Groups, rules)
186186
}
187187

188188
bytes, err := yaml.Marshal(rule)
@@ -244,9 +244,9 @@ func makePrometheusRule(kubeObjective pyrrav1alpha1.ServiceLevelObjective, gener
244244
return nil, fmt.Errorf("failed to get generic rules: %w", err)
245245
}
246246
// ignore these rules
247+
} else {
248+
rule.Groups = append(rule.Groups, rules)
247249
}
248-
249-
rule.Groups = append(rule.Groups, rules)
250250
}
251251

252252
isController := true

0 commit comments

Comments
 (0)