mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
fix: don't overwrite with empty cmd/entrypoint (#1076)
Co-authored-by: ChristopherHX <christopher.homberger@web.de> Signed-off-by: Ryan <me@hackerc.at> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
78987a6f82
commit
410994b2a3
3 changed files with 26 additions and 3 deletions
|
@ -327,14 +327,20 @@ func (cr *containerReference) create(capAdd []string, capDrop []string) common.E
|
|||
|
||||
config := &container.Config{
|
||||
Image: input.Image,
|
||||
Cmd: input.Cmd,
|
||||
Entrypoint: input.Entrypoint,
|
||||
WorkingDir: input.WorkingDir,
|
||||
Env: input.Env,
|
||||
Tty: isTerminal,
|
||||
Hostname: input.Hostname,
|
||||
}
|
||||
|
||||
if len(input.Cmd) != 0 {
|
||||
config.Cmd = input.Cmd
|
||||
}
|
||||
|
||||
if len(input.Entrypoint) != 0 {
|
||||
config.Entrypoint = input.Entrypoint
|
||||
}
|
||||
|
||||
mounts := make([]mount.Mount, 0)
|
||||
for mountSource, mountTarget := range input.Mounts {
|
||||
mounts = append(mounts, mount.Mount{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue