Merge pull request #21961 from yongtang/21956-docker-inspect-log-default-options

Docker inspect gave default log options even when the option is emtpy.
Upstream-commit: e9bef66021a29c219c185e98db7f3017513f67a6
Component: engine
This commit is contained in:
Brian Goff
2016-05-05 21:02:39 -04:00
2 changed files with 14 additions and 10 deletions
-10
View File
@@ -108,16 +108,6 @@ func (daemon *Daemon) getInspectData(container *container.Container, size bool)
hostConfig.Links = append(hostConfig.Links, fmt.Sprintf("%s:%s", child.Name, linkAlias))
}
// we need this trick to preserve empty log driver, so
// container will use daemon defaults even if daemon changes them
if hostConfig.LogConfig.Type == "" {
hostConfig.LogConfig.Type = daemon.defaultLogConfig.Type
}
if len(hostConfig.LogConfig.Config) == 0 {
hostConfig.LogConfig.Config = daemon.defaultLogConfig.Config
}
containerState := &types.ContainerState{
Status: container.State.StateString(),
Running: container.State.Running,