Commit 4d20c38c authored by Cao Shufeng's avatar Cao Shufeng

avoid duplicate status in audit events

parent 6fbca94f
...@@ -171,7 +171,12 @@ func LogResponseObject(ae *auditinternal.Event, obj runtime.Object, gv schema.Gr ...@@ -171,7 +171,12 @@ func LogResponseObject(ae *auditinternal.Event, obj runtime.Object, gv schema.Gr
return return
} }
if status, ok := obj.(*metav1.Status); ok { if status, ok := obj.(*metav1.Status); ok {
ae.ResponseStatus = status // selectively copy the bounded fields.
ae.ResponseStatus = &metav1.Status{
Status: status.Status,
Reason: status.Reason,
Code: status.Code,
}
} }
if ae.Level.Less(auditinternal.LevelRequestResponse) { if ae.Level.Less(auditinternal.LevelRequestResponse) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment