From dbd83a149d91fb31a82b4ae7145412b0542e0ba5 Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Fri, 11 Aug 2023 12:06:00 +0200 Subject: [PATCH] Fix a fmt in SetInstanceMonitor --- daemon/imon/main_cmd.go | 4 ++-- daemon/nmon/main_cmd.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/imon/main_cmd.go b/daemon/imon/main_cmd.go index 75e316c23..6d4b680e2 100644 --- a/daemon/imon/main_cmd.go +++ b/daemon/imon/main_cmd.go @@ -292,9 +292,9 @@ func (o *imon) onSetInstanceMonitor(c *msgbus.SetInstanceMonitor) { continue } if instMon.GlobalExpectUpdatedAt.After(o.state.GlobalExpectUpdatedAt) { - err := fmt.Errorf("%w: %s: %s", instance.ErrSameGlobalExpect, *c.Value.GlobalExpect) + err := fmt.Errorf("%w: %s: more recent value %s on node %s", instance.ErrInvalidGlobalExpect, *c.Value.GlobalExpect, instMon.GlobalExpect, node) sendError(err) - o.log.Info().Msgf("refuse to set global expect '%s': node %s global expect is already '%s'", instMon.GlobalExpect, node, *c.Value.GlobalExpect) + o.log.Info().Msgf("%s", err) globalExpectRefused() return } diff --git a/daemon/nmon/main_cmd.go b/daemon/nmon/main_cmd.go index c76e99254..ab63699c5 100644 --- a/daemon/nmon/main_cmd.go +++ b/daemon/nmon/main_cmd.go @@ -156,7 +156,7 @@ func (o *nmon) onSetNodeMonitor(c *msgbus.SetNodeMonitor) { if *c.Value.GlobalExpect != node.MonitorGlobalExpectAborted { for nodename, data := range o.nodeMonitor { if data.GlobalExpect == *c.Value.GlobalExpect { - err := fmt.Errorf("%w: already targeting %s (on node %s)", node.ErrInvalidGlobalExpect, *c.Value.GlobalExpect, nodename) + err := fmt.Errorf("%w: %s: more recent value %s on node %s", node.ErrInvalidGlobalExpect, *c.Value.GlobalExpect, data.GlobalExpect, nodename) sendError(err) o.log.Info().Msgf("%s", err) return