From 13272b39eff50fab3cf18cdfea50beffc04b6e3e Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Sat, 27 Oct 2018 12:55:07 +0000 Subject: [PATCH] lbagent: add symlink to generated telegraf.conf --- pkg/lbagent/haproxy.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/lbagent/haproxy.go b/pkg/lbagent/haproxy.go index c5ddf67fb8..1fa02a797d 100644 --- a/pkg/lbagent/haproxy.go +++ b/pkg/lbagent/haproxy.go @@ -190,13 +190,15 @@ func (h *HaproxyHelper) useConfigs(ctx context.Context, d string) error { err = os.Symlink(old, new) return err } - keepalivedConf := filepath.Join(h.opts.haproxyConfigDir, "keepalived.conf") - gobetweenJson := filepath.Join(h.opts.haproxyConfigDir, "gobetween.json") haproxyConfD := h.haproxyConfD() + gobetweenJson := filepath.Join(h.opts.haproxyConfigDir, "gobetween.json") + keepalivedConf := filepath.Join(h.opts.haproxyConfigDir, "keepalived.conf") + telegrafConf := filepath.Join(h.opts.haproxyConfigDir, "telegraf.conf") dirMap := map[string]string{ - keepalivedConf: filepath.Join(d, "keepalived.conf"), haproxyConfD: d, gobetweenJson: filepath.Join(d, "gobetween.json"), + keepalivedConf: filepath.Join(d, "keepalived.conf"), + telegrafConf: filepath.Join(d, "telegraf.conf"), } for new, old := range dirMap { err := lnF(old, new)