summaryrefslogtreecommitdiff
path: root/registry/registry.go
diff options
context:
space:
mode:
authorAnil Belur <askb23@gmail.com>2015-11-02 13:38:02 +0530
committerAnil Belur <askb23@gmail.com>2015-11-14 16:24:45 +0530
commit31cdc63419a29badad2d79590db83fe617ee8e03 (patch)
treeb7272b83ef4be913653391c9c36588ea8608a836 /registry/registry.go
parent1448cd3ec26ba98d4a0d53ff02a987ddab80939d (diff)
downloaddocker-31cdc63419a29badad2d79590db83fe617ee8e03.tar.gz
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 <askb23@gmail.com>
Diffstat (limited to 'registry/registry.go')
-rw-r--r--registry/registry.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/registry/registry.go b/registry/registry.go
index e8eb478572..d018f922ac 100644
--- a/registry/registry.go
+++ b/registry/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.