diff options
author | Eyal Soha <eyalsoha@google.com> | 2020-04-24 19:59:05 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-24 20:00:24 -0700 |
commit | c9199bab927e901947c1647de248433aa3d439fb (patch) | |
tree | a7839d8e4a063f17cbd7182a8b0e74c7f71f3274 /pkg/test/dockerutil/dockerutil.go | |
parent | 15a822a1936e295cb6418df7ddf445d8500dfb2e (diff) |
More descriptive error message for missing docker image.
Tested:
Ran a packetimpact test after `docker image rm` and examined the message.
PiperOrigin-RevId: 308370603
Diffstat (limited to 'pkg/test/dockerutil/dockerutil.go')
-rw-r--r-- | pkg/test/dockerutil/dockerutil.go | 5 |
1 files changed, 4 insertions, 1 deletions
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 } |