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
```

Kubernetes-commit: 36b3a0d75b177f7fb3b68750b46dd4c2aeb45664
This commit is contained in:
Kubernetes Publisher 2017-09-08 09:46:36 -07:00
commit 94baeb40da
1 changed files with 2 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import (
"net"
"net/http"
"sync"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@ -147,6 +148,7 @@ func processAuditEvent(sink audit.Sink, ev *auditinternal.Event, omitStages []au
return
}
}
ev.CreationTimestamp = metav1.NewTime(time.Now())
audit.ObserveEvent()
sink.ProcessEvents(ev)
}