Skip to content

Commit f35ba80

Browse files
hdurand0710oktalz
authored andcommitted
BUG/MEDIUM: fix runtime socket commands response parsing
We were not parsing correctly the response from the runtime command socket, and not detecting correctly the errors. The consequence was that if a runtime command failed, we were not triggering a reload and that would lead to inconsistencies between the configuration and the runtime
1 parent 06c3ea9 commit f35ba80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/haproxy/api/runtime.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (c *clientNative) runRaw(runtime runtime.Runtime, sb strings.Builder, backe
104104
}
105105
for i := range result {
106106
if len(result[i]) > 5 {
107-
switch result[i][1:5] {
107+
switch result[i][0:4] {
108108
case "[3]:", "[2]:", "[1]:", "[0]:":
109109
logger.Errorf("[RUNTIME] [BACKEND] [SOCKET] backend %s', server slots adjustment ?", backendName)
110110
logger.Tracef("[RUNTIME] [BACKEND] [SOCKET] backend %s: Error: '%s', server slots adjustment ?", backendName, result[i])

0 commit comments

Comments
 (0)