From 808b691842291cb04cdc16bd3b053c38b765c7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulko?= Date: Thu, 27 Apr 2023 10:56:38 +0200 Subject: [PATCH] Remove creation of 2 Events for the same event `record.Infof()` and `record.Warnf()` both create an event, so there's no need to use both at the same time. This commit removes one such occurrence. --- pkg/cloud/services/loadbalancer/loadbalancer.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/cloud/services/loadbalancer/loadbalancer.go b/pkg/cloud/services/loadbalancer/loadbalancer.go index 816263e828..0e8ae44c3a 100644 --- a/pkg/cloud/services/loadbalancer/loadbalancer.go +++ b/pkg/cloud/services/loadbalancer/loadbalancer.go @@ -364,8 +364,7 @@ func (s *Service) getOrCreateMonitor(openStackCluster *infrav1.OpenStackCluster, monitor, err = s.loadbalancerClient.CreateMonitor(monitorCreateOpts) // Skip creating monitor if it is not supported by Octavia provider if capoerrors.IsNotImplementedError(err) { - record.Warnf(openStackCluster, "SkippedCreateMonitor", "Health monitors are not supported with the current Octavia provider.") - record.Eventf(openStackCluster, "SkippedCreateMonitor", "Health Monitor is not created as it's not implemented with the current Octavia provider.") + record.Warnf(openStackCluster, "SkippedCreateMonitor", "Health Monitor is not created as it's not implemented with the current Octavia provider.") return nil }