Merge pull request #52071 from CaoShuFeng/warning
Automatic merge from submit-queue (batch tested with PRs 52091, 52071) Log a warning when --audit-policy-file not passed to apiserver When audit backend provided, but --audit-policy-file is not passed, leave a info in log. **Release note**: ``` Log a warning when --audit-policy-file not passed to apiserver ``` Kubernetes-commit: 500642602210088447c9dcd7abe2e26815f271ed
This commit is contained in:
		
						commit
						2afdeada7b
					
				|  | @ -22,6 +22,7 @@ import ( | ||||||
| 	"os" | 	"os" | ||||||
| 	"strings" | 	"strings" | ||||||
| 
 | 
 | ||||||
|  | 	"github.com/golang/glog" | ||||||
| 	"github.com/spf13/pflag" | 	"github.com/spf13/pflag" | ||||||
| 	"gopkg.in/natefinch/lumberjack.v2" | 	"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 { | 	if err := o.WebhookOptions.applyTo(c); err != nil { | ||||||
| 		return err | 		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 | 	return nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue