1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Simplify getEntrypointAndArgs

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov 2015-10-27 09:36:08 -07:00
parent b6fa541877
commit 5f6d27ceba

View file

@ -450,21 +450,12 @@ func (daemon *Daemon) generateHostname(id string, config *runconfig.Config) {
}
func (daemon *Daemon) getEntrypointAndArgs(configEntrypoint *stringutils.StrSlice, configCmd *stringutils.StrSlice) (string, []string) {
var (
entrypoint string
args []string
)
cmdSlice := configCmd.Slice()
if configEntrypoint.Len() != 0 {
eSlice := configEntrypoint.Slice()
entrypoint = eSlice[0]
args = append(eSlice[1:], cmdSlice...)
} else {
entrypoint = cmdSlice[0]
args = cmdSlice[1:]
return eSlice[0], append(eSlice[1:], cmdSlice...)
}
return entrypoint, args
return cmdSlice[0], cmdSlice[1:]
}
func (daemon *Daemon) newContainer(name string, config *runconfig.Config, imgID string) (*Container, error) {