mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
layer: relax graphdriver ID format
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
ea36c3cbaf
commit
9a0eb8d330
1 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,6 @@ package layer // import "github.com/docker/docker/layer"
|
||||||
import (
|
import (
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
@ -16,6 +15,7 @@ import (
|
||||||
"github.com/docker/distribution"
|
"github.com/docker/distribution"
|
||||||
"github.com/docker/docker/pkg/ioutils"
|
"github.com/docker/docker/pkg/ioutils"
|
||||||
"github.com/opencontainers/go-digest"
|
"github.com/opencontainers/go-digest"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -194,8 +194,8 @@ func (fms *fileMetadataStore) GetCacheID(layer ChainID) (string, error) {
|
||||||
}
|
}
|
||||||
content := strings.TrimSpace(string(contentBytes))
|
content := strings.TrimSpace(string(contentBytes))
|
||||||
|
|
||||||
if !stringIDRegexp.MatchString(content) {
|
if content == "" {
|
||||||
return "", errors.New("invalid cache id value")
|
return "", errors.Errorf("invalid cache id value")
|
||||||
}
|
}
|
||||||
|
|
||||||
return content, nil
|
return content, nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue