Skip to content

Commit 2f11371

Browse files
committed
MEDIUM: stats: rework stats
Stats now return error when unable to connect to the socket within the response body. If one socket fails the status is 500 but all successful sockets are returned in response body. When initializing runtime client for now we ignore ipv4 runtime APIs as we don't support those yet.
1 parent b561ef5 commit 2f11371

File tree

6 files changed

+1428
-1322
lines changed

6 files changed

+1428
-1322
lines changed

configure_data_plane.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ func configureNativeClient() *client_native.HAProxyClient {
489489
// Override options with env variables
490490
if os.Getenv("HAPROXY_MWORKER") == "1" {
491491
masterRuntime := os.Getenv("HAPROXY_MASTER_CLI")
492-
if masterRuntime != "" {
492+
if masterRuntime != "" && !strings.HasPrefix(masterRuntime, "ipv4@") {
493493
haproxyOptions.MasterRuntime = masterRuntime
494494
}
495495
}
@@ -540,13 +540,15 @@ func configureRuntimeClient(confClient *configuration.Client) *runtime_api.Clien
540540
if len(runtimeAPIs) != 0 {
541541
statsSocketConfigured = true
542542
for _, r := range runtimeAPIs {
543-
socketList = append(socketList, *r.Address)
543+
if !strings.HasPrefix(*r.Address, "ipv4@") {
544+
socketList = append(socketList, *r.Address)
545+
}
544546
}
545547
}
546548

547549
masterSocket := ""
548550
nbproc := 0
549-
if haproxyOptions.MasterRuntime != "" {
551+
if haproxyOptions.MasterRuntime != "" && !strings.HasPrefix(haproxyOptions.MasterRuntime, "ipv4@") {
550552
if globalConf.Nbproc > 0 {
551553
statsSocketConfigured = true
552554
nbproc = int(globalConf.Nbproc)

0 commit comments

Comments
 (0)