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
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
buf := bytes.NewBuffer(configJSON)
|
digest, size := GetSHA256Digest(bytes.NewBuffer(configJSON))
|
||||||
digest, size := GetSHA256Digest(buf)
|
|
||||||
|
|
||||||
layer := &LayerReader{
|
layer := &LayerReader{
|
||||||
Layer: Layer{
|
Layer: Layer{
|
||||||
|
@ -660,7 +659,7 @@ func createConfigLayer(layers []string) (*LayerReader, error) {
|
||||||
Digest: digest,
|
Digest: digest,
|
||||||
Size: size,
|
Size: size,
|
||||||
},
|
},
|
||||||
Reader: buf,
|
Reader: bytes.NewBuffer(configJSON),
|
||||||
}
|
}
|
||||||
return layer, nil
|
return layer, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue