mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
generate systemd: clarify limitations of --new
`generate systemd --new` is looking at the "create command" of the container/pod which is simply the os.Args at creation time. It does not work on containers or pods created via the REST API since the create command is not set. `--new` does work on such containers and pods since there is no reliable way to reverse-map their configs to command-line arguments of podman. Fixes: #11370 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
@ -155,7 +155,7 @@ func generateContainerInfo(ctr *libpod.Container, options entities.GenerateSyste
|
||||
if config.CreateCommand != nil {
|
||||
createCommand = config.CreateCommand
|
||||
} else if options.New {
|
||||
return nil, errors.Errorf("cannot use --new on container %q: no create command found", ctr.ID())
|
||||
return nil, errors.Errorf("cannot use --new on container %q: no create command found: only works on containers created directly with podman but not via REST API", ctr.ID())
|
||||
}
|
||||
|
||||
nameOrID, serviceName := containerServiceName(ctr, options)
|
||||
|
Reference in New Issue
Block a user