mirror of
https://github.com/docker/cli.git
synced 2026-09-28 02:06:53 -04:00
validate log-opt when creating containers AGAIN
Signed-off-by: Shijiang Wei <mountkin@gmail.com> Upstream-commit: 068085005ef378f6320fdce90a67b104399b796d Component: engine
This commit is contained in:
@@ -282,19 +282,6 @@ func (container *Container) exposes(p nat.Port) bool {
|
||||
return exists
|
||||
}
|
||||
|
||||
// GetLogConfig returns the log configuration for the container.
|
||||
func (container *Container) GetLogConfig(defaultConfig containertypes.LogConfig) containertypes.LogConfig {
|
||||
cfg := container.HostConfig.LogConfig
|
||||
if cfg.Type != "" || len(cfg.Config) > 0 { // container has log driver configured
|
||||
if cfg.Type == "" {
|
||||
cfg.Type = jsonfilelog.Name
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
// Use daemon's default log config for containers
|
||||
return defaultConfig
|
||||
}
|
||||
|
||||
// StartLogger starts a new logger driver for the container.
|
||||
func (container *Container) StartLogger(cfg containertypes.LogConfig) (logger.Logger, error) {
|
||||
c, err := logger.GetLogDriver(cfg.Type)
|
||||
|
||||
Reference in New Issue
Block a user