diff --git a/pkg/component/runtime/service.go b/pkg/component/runtime/service.go index bc683193714..6c3123ca05c 100644 --- a/pkg/component/runtime/service.go +++ b/pkg/component/runtime/service.go @@ -312,7 +312,8 @@ func getConnInfoServerAddress(os string, isLocal bool, port int, socket string) } u.Scheme = "unix" - return u.JoinPath(paths.InstallPath(paths.DefaultBasePath), socket).String(), nil + // Use the path that is relative to path.top which corresponds to the agent binary directory in all installation types + return u.JoinPath(paths.Top(), socket).String(), nil } return fmt.Sprintf("127.0.0.1:%d", port), nil diff --git a/pkg/component/runtime/service_test.go b/pkg/component/runtime/service_test.go index 6a18dc9acc4..f4cb14d078c 100644 --- a/pkg/component/runtime/service_test.go +++ b/pkg/component/runtime/service_test.go @@ -236,7 +236,7 @@ func TestGetConnInfoServerAddress(t *testing.T) { u := url.URL{} u.Path = "/" u.Scheme = "unix" - return u.JoinPath(paths.InstallPath(paths.DefaultBasePath), "test.sock").String() + return u.JoinPath(paths.Top(), "test.sock").String() }(), }, }