7d705a7355
This fix tries to fix 26326 where `docker inspect` will not show ulimit even when daemon default ulimit has been set. This fix merge the HostConfig's ulimit with daemon default in `docker inspect`, so that when daemon is started with `default-ulimit` and HostConfig's ulimit is not set, `docker inspect` will output the daemon default. An integration test has been added to cover the changes. This fix fixes 26326. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
19 lines
572 B
Go
19 lines
572 B
Go
package daemon
|
|
|
|
import (
|
|
containertypes "github.com/docker/docker/api/types/container"
|
|
"github.com/docker/docker/container"
|
|
"github.com/docker/docker/libcontainerd"
|
|
"github.com/docker/docker/oci"
|
|
)
|
|
|
|
func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, error) {
|
|
s := oci.DefaultSpec()
|
|
return (*libcontainerd.Spec)(&s), nil
|
|
}
|
|
|
|
// mergeUlimits merge the Ulimits from HostConfig with daemon defaults, and update HostConfig
|
|
// It will do nothing on non-Linux platform
|
|
func (daemon *Daemon) mergeUlimits(c *containertypes.HostConfig) {
|
|
return
|
|
}
|