Improve reporting about individual pull failures
Improve reporting about individual pull failures

Instead of just using multierror to collect the error strings (and hope that they
contain enough context about the attempted image names), explicitly collect pairs of
(attempted image name, error).

Then, report an appropriate error text depending on the failures and environment.

Notably, if there was only one attempt (e.g. a fully-qualified name), just report
the error with minimal context, instead of adding extra "1 error occurred:\n\n".

If search registries were used and empty, note that in the error message (now
for real).

Also, make sure we return _some_ error if util.ResolveName ever returned
an empty list for osome reason.

It seems fairly attractive now to split resolveImage into the outer loop
and a separate function for making one attempt, to consolidate the
repetitive failures = append(...) code.  OTOH that would force us to add
another return value as a "fatal" indication.  Maybe later.

NOTABLY CHANGES BEHAVIOR:
- Changes the error format.
- Restores more detailed error reporting if we have no search registries,
  but had multiple candidates anyway, which was given up in the previous commit.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #909
Approved by: rhatdan

ipbabble/buildah,rhatdan/buildah,nalind/buildah-1,rhatdan/buildah,projectatomic/buildah,nalind/buildah-1,TomSweeneyRedHat/buildah,TomSweeneyRedHat/buildah,TomSweeneyRedHat/buildah,nalind/buildah,ipbabble/buildah,nalind/buildah,nalind/buildah-1,projectatomic/buildah,rhatdan/buildah,projectatomic/buildah