dont consume reader when calculating digest
This commit is contained in:
parent
17b7af78f0
commit
4ca7c4be1f
1 changed files with 2 additions and 3 deletions
|
@ -651,8 +651,7 @@ func createConfigLayer(layers []string) (*LayerReader, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
buf := bytes.NewBuffer(configJSON)
|
||||
digest, size := GetSHA256Digest(buf)
|
||||
digest, size := GetSHA256Digest(bytes.NewBuffer(configJSON))
|
||||
|
||||
layer := &LayerReader{
|
||||
Layer: Layer{
|
||||
|
@ -660,7 +659,7 @@ func createConfigLayer(layers []string) (*LayerReader, error) {
|
|||
Digest: digest,
|
||||
Size: size,
|
||||
},
|
||||
Reader: buf,
|
||||
Reader: bytes.NewBuffer(configJSON),
|
||||
}
|
||||
return layer, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue