Cleaning up listen addresses flags before parsing config file

Signed-off-by: Amim Knabben <aknabben@vmware.com>
This commit is contained in:
Amim Knabben
2022-12-03 20:44:53 -03:00
parent e8991095d4
commit 3aa409590f

View File

@@ -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()
}