From 1820704288cadc715ca98518dd9f43cdee3e05ff Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Mon, 2 Nov 2015 13:38:02 +0530 Subject: [PATCH] Fix for #17168 misleading pull error This fix avoids overwritting the previous error messages, ensures the client gets the correct error messages and not just the most recent message during the pull request. For this `var lastErr` replaced with a slice which acts as a temp place holder for the list of returned error messages for every attempt. The slice is later joined and returned to the caller function after searching for the image with diffirent versions(v2,v1,v0). Updated the code with check for no space left on device error occurance and prevent the daemon on falling back to v1,v0. Incorporated the comments from @calavera, @RichardScothern, @cpuguy83 Signed-off-by: Anil Belur --- docs/registry.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/registry.go b/docs/registry.go index e8eb4785..d018f922 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -13,6 +13,7 @@ import ( "path/filepath" "runtime" "strings" + "syscall" "time" "github.com/Sirupsen/logrus" @@ -219,6 +220,10 @@ func ContinueOnError(err error) bool { return shouldV2Fallback(v) case *client.UnexpectedHTTPResponseError: return true + case error: + if val := strings.Contains(err.Error(), strings.ToLower(syscall.ENOSPC.Error())); val { + return false + } } // let's be nice and fallback if the error is a completely // unexpected one.