Skip to content

Commit f858169

Browse files
authored
Fix connection info socket path that affects DEB/RPM installs (#5031)
1 parent 0e7a211 commit f858169

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/component/runtime/service.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ func getConnInfoServerAddress(os string, isLocal bool, port int, socket string)
312312
}
313313

314314
u.Scheme = "unix"
315-
return u.JoinPath(paths.InstallPath(paths.DefaultBasePath), socket).String(), nil
315+
// Use the path that is relative to path.top which corresponds to the agent binary directory in all installation types
316+
return u.JoinPath(paths.Top(), socket).String(), nil
316317
}
317318

318319
return fmt.Sprintf("127.0.0.1:%d", port), nil

pkg/component/runtime/service_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func TestGetConnInfoServerAddress(t *testing.T) {
236236
u := url.URL{}
237237
u.Path = "/"
238238
u.Scheme = "unix"
239-
return u.JoinPath(paths.InstallPath(paths.DefaultBasePath), "test.sock").String()
239+
return u.JoinPath(paths.Top(), "test.sock").String()
240240
}(),
241241
},
242242
}

0 commit comments

Comments
 (0)