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
2020-06-05 14:57:11 +02:00
parent 402c68b41d
commit 9232d4e443

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