From f858169c0e1c4e8e192be83285faf66ad5158ecc Mon Sep 17 00:00:00 2001 From: Aleksandr Maus Date: Tue, 2 Jul 2024 14:12:11 -0400 Subject: [PATCH] Fix connection info socket path that affects DEB/RPM installs (#5031) --- pkg/component/runtime/service.go | 3 ++- pkg/component/runtime/service_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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() }(), }, }