Skip to content

Commit f456439

Browse files
authored
Merge pull request #2141 from Ace-Tang/runtime_args
bugfix: fix runtime script may be coverd
2 parents 98d107f + e17a455 commit f456439

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

daemon/mgr/container_utils.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,17 @@ func (mgr *ContainerManager) getRuntime(runtime string) (string, error) {
116116

117117
// it is ok to use runtime name as a path.
118118
rPath := runtime
119-
if len(r.RuntimeArgs) > 0 {
120-
rPath = filepath.Join(mgr.Config.HomeDir, RuntimeDir, runtime)
121-
}
122-
123119
// generally speaking, path is not be empty, but we not forbid empty path
124120
// in config set, since name can be a path too.
125121
if r.Path != "" {
126122
rPath = r.Path
127123
}
128124

125+
// if Runtime has args, use script path as runtime path.
126+
if len(r.RuntimeArgs) > 0 {
127+
rPath = filepath.Join(mgr.Config.HomeDir, RuntimeDir, runtime)
128+
}
129+
129130
return rPath, nil
130131
}
131132

0 commit comments

Comments
 (0)