mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #17406 from LK4D4/ent_and_args_simple
Simplify getEntrypointAndArgs
This commit is contained in:
commit
2b1b7823e6
1 changed files with 2 additions and 11 deletions
|
@ -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) {
|
func (daemon *Daemon) getEntrypointAndArgs(configEntrypoint *stringutils.StrSlice, configCmd *stringutils.StrSlice) (string, []string) {
|
||||||
var (
|
|
||||||
entrypoint string
|
|
||||||
args []string
|
|
||||||
)
|
|
||||||
|
|
||||||
cmdSlice := configCmd.Slice()
|
cmdSlice := configCmd.Slice()
|
||||||
if configEntrypoint.Len() != 0 {
|
if configEntrypoint.Len() != 0 {
|
||||||
eSlice := configEntrypoint.Slice()
|
eSlice := configEntrypoint.Slice()
|
||||||
entrypoint = eSlice[0]
|
return eSlice[0], append(eSlice[1:], cmdSlice...)
|
||||||
args = append(eSlice[1:], cmdSlice...)
|
|
||||||
} else {
|
|
||||||
entrypoint = cmdSlice[0]
|
|
||||||
args = cmdSlice[1:]
|
|
||||||
}
|
}
|
||||||
return entrypoint, args
|
return cmdSlice[0], cmdSlice[1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (daemon *Daemon) newContainer(name string, config *runconfig.Config, imgID string) (*Container, error) {
|
func (daemon *Daemon) newContainer(name string, config *runconfig.Config, imgID string) (*Container, error) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue