Skip to content

Commit 9a0eb8d

Browse files
committed
layer: relax graphdriver ID format
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
1 parent ea36c3c commit 9a0eb8d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

layer/filestore.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package layer // import "github.com/docker/docker/layer"
33
import (
44
"compress/gzip"
55
"encoding/json"
6-
"errors"
76
"fmt"
87
"io"
98
"io/ioutil"
@@ -16,6 +15,7 @@ import (
1615
"github.com/docker/distribution"
1716
"github.com/docker/docker/pkg/ioutils"
1817
"github.com/opencontainers/go-digest"
18+
"github.com/pkg/errors"
1919
"github.com/sirupsen/logrus"
2020
)
2121

@@ -194,8 +194,8 @@ func (fms *fileMetadataStore) GetCacheID(layer ChainID) (string, error) {
194194
}
195195
content := strings.TrimSpace(string(contentBytes))
196196

197-
if !stringIDRegexp.MatchString(content) {
198-
return "", errors.New("invalid cache id value")
197+
if content == "" {
198+
return "", errors.Errorf("invalid cache id value")
199199
}
200200

201201
return content, nil

0 commit comments

Comments
 (0)