Skip to content

Commit

Permalink
Fix to improper formatting of UnhealthyRange
Browse files Browse the repository at this point in the history
Signed-off-by: killianmuldoon <[email protected]>
  • Loading branch information
killianmuldoon committed Jan 12, 2022
1 parent 1e13f44 commit ec2497d
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ func (r *Reconciler) reconcile(ctx context.Context, logger logr.Logger, cluster
Status: corev1.ConditionFalse,
Severity: clusterv1.ConditionSeverityWarning,
Reason: clusterv1.TooManyUnhealthyReason,
Message: message,
Message: formatPercentSign(message),
})

r.recorder.Eventf(
m,
corev1.EventTypeWarning,
EventRemediationRestricted,
message,
formatPercentSign(message),
)
errList := []error{}
for _, t := range append(healthy, unhealthy...) {
Expand Down Expand Up @@ -659,3 +659,11 @@ func (r *Reconciler) externalRemediationRequestExists(ctx context.Context, m *cl
}
return remediationReq != nil
}

func formatPercentSign(message string) string {
var out string
if strings.Contains(message, "%") {
out = strings.Replace(message, "%", "%%", -1)
}
return out
}

0 comments on commit ec2497d

Please sign in to comment.