summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/containers.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-08-31 14:51:39 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-09-01 08:50:03 +0200
commitf9a689f3ed016fcb9e4d9c0614ee9979b1e8ecd7 (patch)
treecd7b9b7e2b9552c51be89c9192add605dfa9c6cf /pkg/systemd/generate/containers.go
parentbebaef26fdd5d3ae8a29f04d36c437f316fc1bc8 (diff)
downloadpodman-f9a689f3ed016fcb9e4d9c0614ee9979b1e8ecd7.tar.gz
podman-f9a689f3ed016fcb9e4d9c0614ee9979b1e8ecd7.tar.bz2
podman-f9a689f3ed016fcb9e4d9c0614ee9979b1e8ecd7.zip
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>
Diffstat (limited to 'pkg/systemd/generate/containers.go')
-rw-r--r--pkg/systemd/generate/containers.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/systemd/generate/containers.go b/pkg/systemd/generate/containers.go
index 931f13972..188926115 100644
--- a/pkg/systemd/generate/containers.go
+++ b/pkg/systemd/generate/containers.go
@@ -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)