Skip to content

Commit 4858a53

Browse files
added BinAddr field in agent/self API response (#22761)
1 parent cdfc565 commit 4858a53

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

agent/agent_endpoint.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package agent
66
import (
77
"encoding/json"
88
"fmt"
9+
"net"
910
"net/http"
1011
"strconv"
1112
"strings"
@@ -121,6 +122,7 @@ func (s *HTTPHandlers) AgentSelf(resp http.ResponseWriter, req *http.Request) (i
121122
Server bool
122123
Version string
123124
BuildDate string
125+
BindAddr net.IP
124126
}{
125127
Datacenter: displayConfig.Datacenter,
126128
PrimaryDatacenter: displayConfig.PrimaryDatacenter,
@@ -132,6 +134,12 @@ func (s *HTTPHandlers) AgentSelf(resp http.ResponseWriter, req *http.Request) (i
132134
// We expect the ent version to be part of the reported version string, and that's now part of the metadata, not the actual version.
133135
Version: displayConfig.VersionWithMetadata(),
134136
BuildDate: displayConfig.BuildDate.Format(time.RFC3339),
137+
BindAddr: func() net.IP {
138+
if displayConfig.BindAddr != nil {
139+
return displayConfig.BindAddr.IP
140+
}
141+
return nil
142+
}(),
135143
}
136144

137145
return Self{

0 commit comments

Comments
 (0)