From ea5d25cecb1f69a68dbc922e2190f7882bc5672d Mon Sep 17 00:00:00 2001 From: Ace-Tang Date: Mon, 2 Jul 2018 11:25:21 +0800 Subject: [PATCH] bugfix: fix memory-swap flag not validate correct amendContainerSettings should before validateConfig Signed-off-by: Ace-Tang --- daemon/mgr/container.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/mgr/container.go b/daemon/mgr/container.go index f2539ceee..98e3b50e3 100644 --- a/daemon/mgr/container.go +++ b/daemon/mgr/container.go @@ -385,15 +385,15 @@ func (mgr *ContainerManager) Create(ctx context.Context, name string, config *ty container.Snapshotter.Data["UpperDir"] = upperDir } + // amendContainerSettings modify container config settings to wanted + amendContainerSettings(&config.ContainerConfig, config.HostConfig) + // validate container Config warnings, err := validateConfig(&config.ContainerConfig, config.HostConfig, false) if err != nil { return nil, err } - // amendContainerSettings modify container config settings to wanted - amendContainerSettings(&config.ContainerConfig, config.HostConfig) - // store disk if err := container.Write(mgr.Store); err != nil { logrus.Errorf("failed to update meta: %v", err)