From 50d81c2a3859c3cd692dd8dfb8273025c59c74e3 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Thu, 5 Jun 2025 07:58:34 +0200 Subject: [PATCH] Move cluser node specific files it thier own directories in Support Packet (#30755) --- server/channels/app/support_packet.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/server/channels/app/support_packet.go b/server/channels/app/support_packet.go index f30c248454..b34687ef59 100644 --- a/server/channels/app/support_packet.go +++ b/server/channels/app/support_packet.go @@ -5,6 +5,7 @@ package app import ( "encoding/json" + "path/filepath" "slices" "sync" @@ -63,8 +64,21 @@ func (a *App) GenerateSupportPacket(rctx request.CTX, options *model.SupportPack if err != nil { warnings = multierror.Append(warnings, err) } - if files != nil { - fileDatas = append(fileDatas, files...) + + if fileDatas != nil { + if cluster := a.Cluster(); cluster != nil && *a.Config().ClusterSettings.Enable { + hostname := cluster.GetMyClusterInfo().Hostname + for _, file := range files { + // When running in a cluster, the files are generated with the cluster node name as the directory, e.g. 7917b92f9e4c/mattermost.log + fileDatas = append(fileDatas, model.FileData{ + Filename: filepath.Join(hostname, file.Filename), + Body: file.Body, + }) + } + } else { + // When running in standalone mode, all files are generated with the same directory name, e.g. mattermost.log. + fileDatas = append(fileDatas, files...) + } } mut.Unlock() }()