fix: fallback agent download for legacy docker layout

This commit is contained in:
rcourtman 2025-10-14 09:56:40 +00:00
parent 5c79d2516d
commit c389c7625d

View file

@ -2716,12 +2716,13 @@ func (r *Router) handleDownloadAgent(w http.ResponseWriter, req *http.Request) {
w.Header().Set("Expires", "0")
archParam := strings.TrimSpace(req.URL.Query().Get("arch"))
searchPaths := make([]string, 0, 4)
searchPaths := make([]string, 0, 6)
if normalized := normalizeDockerAgentArch(archParam); normalized != "" {
searchPaths = append(searchPaths,
filepath.Join("/opt/pulse/bin", "pulse-docker-agent-"+normalized),
filepath.Join("/opt/pulse", "pulse-docker-agent-"+normalized),
filepath.Join("/app", "pulse-docker-agent-"+normalized), // legacy Docker image layout
)
}
@ -2729,6 +2730,7 @@ func (r *Router) handleDownloadAgent(w http.ResponseWriter, req *http.Request) {
searchPaths = append(searchPaths,
filepath.Join("/opt/pulse/bin", "pulse-docker-agent"),
"/opt/pulse/pulse-docker-agent",
filepath.Join("/app", "pulse-docker-agent"), // legacy Docker image layout
)
for _, candidate := range searchPaths {