Skip to content

Commit

Permalink
fix addr bind
Browse files Browse the repository at this point in the history
Signed-off-by: zhaocongqi <[email protected]>
  • Loading branch information
zhaocongqi committed Dec 30, 2024
1 parent 1c2877e commit 51ca060
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ovn_monitor/ovn_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func CmdMain() {
addr := config.ListenAddress
if os.Getenv("ENABLE_BIND_LOCAL_IP") == "true" {
if ips := strings.Split(os.Getenv("POD_IPS"), ","); len(ips) == 1 {
addr = util.JoinHostPort(ips[0], port)
addr = ips[0]
}
}

Expand All @@ -51,6 +51,7 @@ func CmdMain() {
go exporter.TryClientConnection()
}
exporter.StartOvnMetrics()
addr = util.JoinHostPort(addr, port)
if err = metrics.Run(ctx, nil, addr, config.SecureServing, false); err != nil {
util.LogFatalAndExit(err, "failed to run metrics server")
}
Expand Down

0 comments on commit 51ca060

Please sign in to comment.