Merge pull request #1870 from tianon/invoke-entrypoint-fixes

pull/1835/head
Justin Chadwell 2 years ago committed by GitHub
commit c30bcade2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -726,6 +726,9 @@ func parseInvokeConfig(invoke string) (cfg invokeConfig, err error) {
cfg.Cmd = append(cfg.Cmd, value) // TODO: support JSON
case "entrypoint":
cfg.Entrypoint = append(cfg.Entrypoint, value) // TODO: support JSON
if cfg.Cmd == nil {
cfg.Cmd = []string{}
}
case "env":
cfg.Env = append(cfg.Env, value)
case "user":

@ -282,6 +282,7 @@ func (m *monitor) startInvoke(ctx context.Context, pid string, cfg controllerapi
}
if len(cfg.Entrypoint) == 0 && len(cfg.Cmd) == 0 {
cfg.Entrypoint = []string{"sh"} // launch shell by default
cfg.Cmd = []string{}
}
go func() {
// Start a new invoke

Loading…
Cancel
Save