Merge pull request #94066 from lojies/auditlogcompress

add audit-log-compress to apiserver
This commit is contained in:
Kubernetes Prow Robot 2020-10-29 14:16:06 -07:00 committed by GitHub
commit 5ee72a49cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,6 +120,7 @@ type AuditLogOptions struct {
MaxBackups int
MaxSize int
Format string
Compress bool
BatchOptions AuditBatchOptions
TruncateOptions AuditTruncateOptions
@ -449,6 +450,7 @@ func (o *AuditLogOptions) AddFlags(fs *pflag.FlagSet) {
strings.Join(pluginlog.AllowedFormats, ",")+".")
fs.StringVar(&o.GroupVersionString, "audit-log-version", o.GroupVersionString,
"API group and version used for serializing audit events written to log.")
fs.BoolVar(&o.Compress, "audit-log-compress", o.Compress, "If set, the rotated log files will be compressed using gzip.")
}
func (o *AuditLogOptions) Validate() []error {
@ -513,6 +515,7 @@ func (o *AuditLogOptions) getWriter() io.Writer {
MaxAge: o.MaxAge,
MaxBackups: o.MaxBackups,
MaxSize: o.MaxSize,
Compress: o.Compress,
}
}
return w