Skip to content

Commit

Permalink
MINOR: fix info message when global config is updated
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Doucet <odoucet@oxeva.fr>
  • Loading branch information
odoucet authored and oktalz committed May 29, 2024
1 parent bd2a662 commit 909bdd7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/controller/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func (c *HAProxyController) globalCfg() {
var newGlobal, global *models.Global
var newLg models.LogTargets
var err error
var updated []string
global, err = c.haproxy.GlobalGetConfiguration()
if err != nil {
logger.Error(err)
Expand Down Expand Up @@ -91,13 +90,12 @@ func (c *HAProxyController) globalCfg() {
diff := newGlobal.Diff(*global)
if len(diff) != 0 {
logger.Error(c.haproxy.GlobalPushConfiguration(*newGlobal))
instance.Restart("Global config updated: %s", strings.Join(updated, "\n"))
instance.Restart("Global config updated: %v", diff)
}
diff = newLg.Diff(lg)
// updated = deep.Equal(newLg, lg)
if len(diff) != 0 {
logger.Error(c.haproxy.GlobalPushLogTargets(newLg))
instance.Restart("Global log targets updated: %s", strings.Join(updated, "\n"))
instance.Restart("Global log targets updated: %v", diff)
}
c.globalCfgSnipp()
}
Expand Down

0 comments on commit 909bdd7

Please sign in to comment.