Skip to content

Commit 223016e

Browse files
committed
chore: refactor status conditions
1 parent c7af124 commit 223016e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

internal/common/status_conditions.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ func SetCondition(to conditions.Setter, status metav1.ConditionStatus, reason, m
3737

3838
// updateMetrics handles updating the failure counters for each type
3939
func updateMetrics(to conditions.Setter, status metav1.ConditionStatus) {
40-
var value float64
41-
switch status {
42-
case metav1.ConditionTrue:
43-
value = 0
44-
case metav1.ConditionFalse:
45-
value = 1
40+
value := 0.0
41+
if status == metav1.ConditionFalse {
42+
value = 1.0
4643
}
4744

4845
switch o := to.(type) {

0 commit comments

Comments
 (0)