From 83de9258ba578477e8a2d1e45cd365fc01174c05 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Thu, 24 Oct 2024 17:04:45 +1300 Subject: [PATCH] OCPBUGS-43768: Log correct hostname for validation status The log prefix was getting set the first time through the host loop and not getting modified for subsequent hosts. We need to calculate it anew for each host. --- pkg/agent/validations.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/agent/validations.go b/pkg/agent/validations.go index 2df07cefc17..c137e3caf61 100644 --- a/pkg/agent/validations.go +++ b/pkg/agent/validations.go @@ -34,7 +34,7 @@ type validationResultHistory struct { previousMessage string } -func checkValidations(cluster *models.Cluster, validationResults *validationResults, log *logrus.Logger, hostLogPrefix string) error { +func checkValidations(cluster *models.Cluster, validationResults *validationResults, log *logrus.Logger, logPrefix string) error { clusterLogPrefix := "Cluster validation: " updatedClusterValidationHistory, err := updateValidationResultHistory(clusterLogPrefix, cluster.ValidationsInfo, validationResults.ClusterValidationHistory, log) if err != nil { @@ -43,6 +43,7 @@ func checkValidations(cluster *models.Cluster, validationResults *validationResu validationResults.ClusterValidationHistory = updatedClusterValidationHistory for _, h := range cluster.Hosts { + hostLogPrefix := logPrefix if hostLogPrefix == "" { hostLogPrefix = "Host " + h.RequestedHostname + " validation: " }