Log a warning when --audit-policy-file not passed to apiserver

Kubernetes-commit: 3b91f1cc0d32278a9baf2a4b9b4e416cbfb2457f
This commit is contained in:
Cao Shufeng 2017-09-07 11:04:58 +08:00 committed by Kubernetes Publisher
parent 2c3f99c328
commit d2f7a0c820
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import (
"os"
"strings"
"github.com/golang/glog"
"github.com/spf13/pflag"
"gopkg.in/natefinch/lumberjack.v2"
@ -164,6 +165,10 @@ func (o *AuditOptions) ApplyTo(c *server.Config) error {
if err := o.WebhookOptions.applyTo(c); err != nil {
return err
}
if c.AuditBackend != nil && c.AuditPolicyChecker == nil {
glog.V(2).Info("No audit policy file provided for AdvancedAuditing, no events will be recorded.")
}
return nil
}