Merge pull request #108147 from tallclair/audit

Don't decorate admission for audit when audit is disabled
This commit is contained in:
Kubernetes Prow Robot 2022-02-16 15:26:19 -08:00 committed by GitHub
commit 0874cfddda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ var _ ValidationInterface = &auditHandler{}
// Validate function must be instance of privateAnnotationsGetter or
// AnnotationsGetter, otherwise an error is returned.
func WithAudit(i Interface, ae *auditinternal.Event) Interface {
if i == nil {
if i == nil || ae == nil {
return i
}
return &auditHandler{Interface: i, ae: ae}