forked from TrueCloudLab/distribution
commit
e1c4101dce
1 changed files with 5 additions and 0 deletions
|
@ -448,6 +448,11 @@ func (r *Registry) PushImageLayerRegistry(imgID string, layer io.Reader, registr
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("Failed to upload layer: %s", err)
|
return "", fmt.Errorf("Failed to upload layer: %s", err)
|
||||||
}
|
}
|
||||||
|
if rc, ok := layer.(io.Closer); ok {
|
||||||
|
if err := rc.Close(); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
}
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
|
|
||||||
if res.StatusCode != 200 {
|
if res.StatusCode != 200 {
|
||||||
|
|
Loading…
Reference in a new issue