mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Merge pull request #52030 from soltysh/creationtimestamp_audit
Automatic merge from submit-queue (batch tested with PRs 51900, 51782, 52030) Fill in creationtimestamp in audit events **What this PR does / why we need it**: This is fixing null creationtimestamp in audit events. @sttts @crassirostris like we've talked earlier today **Release note**: ```release-note none ```
This commit is contained in:
commit
36b3a0d75b
@ -23,6 +23,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||||
@ -147,6 +148,7 @@ func processAuditEvent(sink audit.Sink, ev *auditinternal.Event, omitStages []au
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ev.CreationTimestamp = metav1.NewTime(time.Now())
|
||||||
audit.ObserveEvent()
|
audit.ObserveEvent()
|
||||||
sink.ProcessEvents(ev)
|
sink.ProcessEvents(ev)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user