Skip to content

Commit

Permalink
Fix connection info socket path that affects DEB/RPM installs (#5031)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksmaus authored Jul 2, 2024
1 parent 0e7a211 commit f858169
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/component/runtime/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/component/runtime/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}(),
},
}
Expand Down

0 comments on commit f858169

Please sign in to comment.