feat: log more information for patching a resource (#2369)

This commit is contained in:
Benjamin Eder 2023-03-13 19:17:16 +01:00
parent 47879d1bcc
commit 2837370e28
No known key found for this signature in database
GPG Key ID: 21B6BE3EC42C7B29

View File

@ -11,6 +11,9 @@ import (
"path/filepath"
"strings"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"github.com/shirou/gopsutil/v3/disk"
"github.com/spf13/afero"
@ -240,8 +243,9 @@ func resourcePatchHandler(fileCache FileCache) handleFunc {
}, action, src, dst, d.user)
if err == nil {
titleAction := cases.Title(language.English).String(action)
audit.LogResourceActivity(audit.ResourceActivity{
Event: "Patch",
Event: fmt.Sprintf("%v with destination %v", titleAction, dst),
ResourcePath: r.URL.Path,
User: d.user,
})