Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
| ... | ... |
@@ -3,7 +3,6 @@ package layer // import "github.com/docker/docker/layer" |
| 3 | 3 |
import ( |
| 4 | 4 |
"compress/gzip" |
| 5 | 5 |
"encoding/json" |
| 6 |
- "errors" |
|
| 7 | 6 |
"fmt" |
| 8 | 7 |
"io" |
| 9 | 8 |
"io/ioutil" |
| ... | ... |
@@ -16,6 +15,7 @@ import ( |
| 16 | 16 |
"github.com/docker/distribution" |
| 17 | 17 |
"github.com/docker/docker/pkg/ioutils" |
| 18 | 18 |
"github.com/opencontainers/go-digest" |
| 19 |
+ "github.com/pkg/errors" |
|
| 19 | 20 |
"github.com/sirupsen/logrus" |
| 20 | 21 |
) |
| 21 | 22 |
|
| ... | ... |
@@ -194,8 +194,8 @@ func (fms *fileMetadataStore) GetCacheID(layer ChainID) (string, error) {
|
| 194 | 194 |
} |
| 195 | 195 |
content := strings.TrimSpace(string(contentBytes)) |
| 196 | 196 |
|
| 197 |
- if !stringIDRegexp.MatchString(content) {
|
|
| 198 |
- return "", errors.New("invalid cache id value")
|
|
| 197 |
+ if content == "" {
|
|
| 198 |
+ return "", errors.Errorf("invalid cache id value")
|
|
| 199 | 199 |
} |
| 200 | 200 |
|
| 201 | 201 |
return content, nil |