Skip to content

Commit

Permalink
config: multiple web.listen-address args results into an error, if --…
Browse files Browse the repository at this point in the history
…config.file is defined.

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
  • Loading branch information
jkroepke committed Feb 9, 2025
1 parent 1b2958a commit 285b165
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/windows_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func run() int {
// 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:]
*webConfig.WebListenAddresses = slices.Compact(*webConfig.WebListenAddresses)

// Parse flags once more to include those discovered in configuration file(s).
if _, err = app.Parse(os.Args[1:]); err != nil {
Expand Down

0 comments on commit 285b165

Please sign in to comment.