Skip to content

Commit

Permalink
Remove creation of 2 Events for the same event
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
dulek authored and k8s-infra-cherrypick-robot committed Apr 27, 2023
1 parent c9239d5 commit 808b691
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/cloud/services/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 808b691

Please sign in to comment.