mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
750f0d1648
Configuration over the API per container is intentionally left out for the time being, but is supported to configure the default from the daemon config. Signed-off-by: Brian Goff <cpuguy83@gmail.com> (cherry picked from commit cbecf48bc352e680a5390a7ca9cff53098cd16d7) Signed-off-by: Madhu Venugopal <madhu@docker.com>
29 lines
1 KiB
Go
29 lines
1 KiB
Go
package logger
|
|
|
|
var externalValidators []LogOptValidator
|
|
|
|
// RegisterExternalValidator adds the validator to the list of external validators.
|
|
// External validators are used by packages outside this package that need to add their own validation logic.
|
|
// This should only be called on package initialization.
|
|
func RegisterExternalValidator(v LogOptValidator) {
|
|
externalValidators = append(externalValidators, v)
|
|
}
|
|
|
|
// AddBuiltinLogOpts updates the list of built-in log opts. This allows other packages to supplement additional log options
|
|
// without having to register an actual log driver. This is used by things that are more proxy log drivers and should
|
|
// not be exposed as a usable log driver to the API.
|
|
// This should only be called on package initialization.
|
|
func AddBuiltinLogOpts(opts map[string]bool) {
|
|
for k, v := range opts {
|
|
builtInLogOpts[k] = v
|
|
}
|
|
}
|
|
|
|
func validateExternal(cfg map[string]string) error {
|
|
for _, v := range externalValidators {
|
|
if err := v(cfg); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|