Skip to content

Commit 7db24f4

Browse files
daniel-corbettmjuraga
authored andcommitted
BUG/MEDIUM: runtime: Strip unix@ from master cli socket
When the master cli is configured as a unix socket HAProxy is sending the path to the master cli as "unix@/path/to/master.sock" within the environment variable HAPROXY_MASTER_CLI. The Data Plane API is then trying to take this string and connect to it without stripping the 'unix@' portion off. This causes an error during connect() as seen in the below strace: [pid 17968] connect(14, {sa_family=AF_UNIX, sun_path="unix@/tmp/master.sock"}, 24) = -1 ENOENT (No such file or directory) This should be the path only "/tmp/master.sock" and not "unix@/tmp/master.sock". This issue was also referenced in #50 but the work around ended up being to remove use of the master cli completely. This commit fixes the underlying issue and strips 'unix@' from the socket path allowing for the master cli to be used.
1 parent d3d5f6b commit 7db24f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

configure_data_plane.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func configureAPI(api *operations.DataPlaneAPI) http.Handler {
9797
mWorker = true
9898
masterRuntime := os.Getenv("HAPROXY_MASTER_CLI")
9999
if misc.IsUnixSocketAddr(masterRuntime) {
100-
haproxyOptions.MasterRuntime = masterRuntime
100+
haproxyOptions.MasterRuntime = strings.Replace(masterRuntime, "unix@", "", 1)
101101
}
102102
}
103103
cfgFiles := os.Getenv("HAPROXY_CFGFILES")

0 commit comments

Comments
 (0)