Skip to content

Commit 5f8e85f

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 8b35ad9 commit 5f8e85f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/haproxy/api/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (c *clientNative) runRaw(runtime runtime.Runtime, sb strings.Builder, backe
103103
return err
104104
}
105105
if len(result) > 5 {
106-
switch result[1:5] {
106+
switch result[0:4] {
107107
case "[3]:", "[2]:", "[1]:", "[0]:":
108108
logger.Errorf("[RUNTIME] [BACKEND] [SOCKET] backend %s', server slots adjustment ?", backendName)
109109
logger.Tracef("[RUNTIME] [BACKEND] [SOCKET] backend %s: Error: '%s', server slots adjustment ?", backendName, result)

0 commit comments

Comments
 (0)