From c9199bab927e901947c1647de248433aa3d439fb Mon Sep 17 00:00:00 2001 From: Eyal Soha Date: Fri, 24 Apr 2020 19:59:05 -0700 Subject: More descriptive error message for missing docker image. Tested: Ran a packetimpact test after `docker image rm` and examined the message. PiperOrigin-RevId: 308370603 --- pkg/test/dockerutil/dockerutil.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/test/dockerutil') diff --git a/pkg/test/dockerutil/dockerutil.go b/pkg/test/dockerutil/dockerutil.go index baa8fc2f2..5f2af9f3b 100644 --- a/pkg/test/dockerutil/dockerutil.go +++ b/pkg/test/dockerutil/dockerutil.go @@ -353,7 +353,10 @@ func (d *Docker) run(r RunOpts, command string, p ...string) (string, error) { // Create calls 'docker create' with the arguments provided. func (d *Docker) Create(r RunOpts, args ...string) error { - _, err := d.run(r, "create", args...) + out, err := d.run(r, "create", args...) + if strings.Contains(out, "Unable to find image") { + return fmt.Errorf("unable to find image, did you remember to `make load-%s`: %w", r.Image, err) + } return err } -- cgit v1.2.3