Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conditions/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func mirror(from Getter, targetCondition kmapi.ConditionType, options ...MirrorO
case true:
condition = TrueCondition(targetCondition)
case false:
condition = FalseCondition(targetCondition, mirrorOpt.fallbackReason, mirrorOpt.fallbackSeverity, mirrorOpt.fallbackMessage) //nolint:govet
condition = FalseCondition(targetCondition, mirrorOpt.fallbackReason, mirrorOpt.fallbackSeverity, "%s", mirrorOpt.fallbackMessage)
}
}

Expand Down
9 changes: 4 additions & 5 deletions conditions/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ type localizedCondition struct {
}

// merge a list of condition into a single one.
// This operation is designed to ensure visibility of the most relevant util for defining the
// This operation is designed to ensure visibility of the most relevant conditions for defining the
// operational state of a component. E.g. If there is one error in the condition list, this one takes
// priority over the other util, and it should be reflected in the target condition.
// priority over the other conditions and it is should be reflected in the target condition.
//
// More specifically:
// 1. Conditions are grouped by status, severity
Expand Down Expand Up @@ -63,11 +63,10 @@ func merge(conditions []localizedCondition, targetCondition kmapi.ConditionType,

targetReason := getReason(g, options)
targetMessage := getMessage(g, options)

if g.TopGroup().status == metav1.ConditionFalse {
return FalseCondition(targetCondition, targetReason, g.TopGroup().severity, targetMessage) //nolint:govet
return FalseCondition(targetCondition, targetReason, g.TopGroup().severity, "%s", targetMessage)
}
return UnknownCondition(targetCondition, targetReason, targetMessage) //nolint:govet
return UnknownCondition(targetCondition, targetReason, "%s", targetMessage)
}

// getConditionGroups groups a list of conditions according to status, severity values.
Expand Down
Loading