save deploymentID to avoid mutating request entry in Audit (#16053)

This commit is contained in:
jiuker authored and GitHub committed 2022-11-11 12:42:15 -08:00
1 parent ce299b47ea
commit bf89f79694
1 file changed
+3 -2
+3 -2
View File
@@ -289,8 +289,9 @@ func errToEntry(ctx context.Context, err error, errKind ...interface{}) log.Entr
// Get the cause for the Error
message := fmt.Sprintf("%v (%T)", err, err)
deploymentID := req.DeploymentID
if req.DeploymentID == "" {
req.DeploymentID = xhttp.GlobalDeploymentID
deploymentID = xhttp.GlobalDeploymentID
}
objects := make([]log.ObjectVersion, 0, len(req.Objects))
@@ -302,7 +303,7 @@ func errToEntry(ctx context.Context, err error, errKind ...interface{}) log.Entr
}
entry := log.Entry{
DeploymentID: req.DeploymentID,
DeploymentID: deploymentID,
Level: ErrorLvl.String(),
LogKind: logKind,
RemoteHost: req.RemoteHost,