From c721ce2a621ee52509e1a14f4c4d543f9eda0383 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Fri, 21 Nov 2025 22:32:10 +0600 Subject: [PATCH] Fix tests Signed-off-by: Tamal Saha --- conditions/getter.go | 2 +- conditions/merge.go | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/conditions/getter.go b/conditions/getter.go index b915573eb..4bfa177a6 100644 --- a/conditions/getter.go +++ b/conditions/getter.go @@ -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) } } diff --git a/conditions/merge.go b/conditions/merge.go index e1ab6bc6e..ba18d905b 100644 --- a/conditions/merge.go +++ b/conditions/merge.go @@ -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 @@ -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.