From c086db14b7fd50915c982d4f6f3b866b23da0da9 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Tue, 17 Apr 2018 15:45:39 -0700 Subject: [PATCH] layer: relax graphdriver ID format Signed-off-by: Tonis Tiigi Upstream-commit: 9a0eb8d330797fa62dc59667aea6efbb7cdb9181 Component: engine --- components/engine/layer/filestore.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/engine/layer/filestore.go b/components/engine/layer/filestore.go index b1cbb80166..208a0c3a85 100644 --- a/components/engine/layer/filestore.go +++ b/components/engine/layer/filestore.go @@ -3,7 +3,6 @@ package layer // import "github.com/docker/docker/layer" import ( "compress/gzip" "encoding/json" - "errors" "fmt" "io" "io/ioutil" @@ -16,6 +15,7 @@ import ( "github.com/docker/distribution" "github.com/docker/docker/pkg/ioutils" "github.com/opencontainers/go-digest" + "github.com/pkg/errors" "github.com/sirupsen/logrus" ) @@ -194,8 +194,8 @@ func (fms *fileMetadataStore) GetCacheID(layer ChainID) (string, error) { } content := strings.TrimSpace(string(contentBytes)) - if !stringIDRegexp.MatchString(content) { - return "", errors.New("invalid cache id value") + if content == "" { + return "", errors.Errorf("invalid cache id value") } return content, nil