From e17a455ab4d9450c652e0be757a4b00404d12645 Mon Sep 17 00:00:00 2001 From: Ace-Tang Date: Wed, 22 Aug 2018 18:38:41 +0800 Subject: [PATCH] bugfix: fix runtime script may be coverd if condition should change location, or runtime script path will be coverd by runtime path. Signed-off-by: Ace-Tang --- daemon/mgr/container_utils.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/daemon/mgr/container_utils.go b/daemon/mgr/container_utils.go index e394f8866..cc2781042 100644 --- a/daemon/mgr/container_utils.go +++ b/daemon/mgr/container_utils.go @@ -116,16 +116,17 @@ func (mgr *ContainerManager) getRuntime(runtime string) (string, error) { // it is ok to use runtime name as a path. rPath := runtime - if len(r.RuntimeArgs) > 0 { - rPath = filepath.Join(mgr.Config.HomeDir, RuntimeDir, runtime) - } - // generally speaking, path is not be empty, but we not forbid empty path // in config set, since name can be a path too. if r.Path != "" { rPath = r.Path } + // if Runtime has args, use script path as runtime path. + if len(r.RuntimeArgs) > 0 { + rPath = filepath.Join(mgr.Config.HomeDir, RuntimeDir, runtime) + } + return rPath, nil }