generate systemd: rephrase lookup error

Rephrase the lookup error when the specified name or ID does not refer
to a container or pod.  Until, only the pod-lookup error has been
returned which can be confusing when actually looking for a container;
a user might have just mistyped the ID or name.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg committed 2020-06-11 11:01:13 +02:00
1 parent 402c68b41d
commit 9232d4e443
1 file changed
+1 -1
+1 -1
View File
@@ -40,7 +40,7 @@ func (ic *ContainerEngine) GenerateSystemd(ctx context.Context, nameOrID string,
// We're either having a pod or garbage.
pod, err := ic.Libpod.LookupPod(nameOrID)
if err != nil {
return nil, err
return nil, errors.Errorf("%q does not refer to a container or pod", nameOrID)
}
// Error out if the pod has no infra container, which we require to be the