From 3aa409590f45599c72ac3e916ff02aa9568b0924 Mon Sep 17 00:00:00 2001 From: Amim Knabben Date: Sat, 3 Dec 2022 20:44:53 -0300 Subject: [PATCH] Cleaning up listen addresses flags before parsing config file Signed-off-by: Amim Knabben --- exporter.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exporter.go b/exporter.go index dec423bf..1f26a169 100644 --- a/exporter.go +++ b/exporter.go @@ -303,6 +303,12 @@ func main() { if err != nil { log.Fatalf("%v\n", err) } + + // NOTE: This is temporary fix for issue #1092, calling kingpin.Parse + // twice makes slices flags duplicate its value, this clean up + // the first parse before the second call. + *webConfig.WebListenAddresses = (*webConfig.WebListenAddresses)[1:] + // Parse flags once more to include those discovered in configuration file(s). kingpin.Parse() }