Update containers/storage to pick up overlay driver fix

New pinned commit is ff8a6d2bf496daf46ab1a153f783a0f6b8762a54

This includes a fix to error reporting with overlayfs, and will
produce more verbose errors when initializing overlayfs fails.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #546
Approved by: baude
This commit is contained in:
Matthew Heon
2018-03-25 10:44:21 -04:00
committed by Atomic Bot
parent 1d4f40bd1a
commit f2894f243b
15 changed files with 321 additions and 54 deletions

View File

@ -124,10 +124,25 @@ type imageStore struct {
bydigest map[digest.Digest][]*Image
}
func copyImage(i *Image) *Image {
return &Image{
ID: i.ID,
Digest: i.Digest,
Names: copyStringSlice(i.Names),
TopLayer: i.TopLayer,
Metadata: i.Metadata,
BigDataNames: copyStringSlice(i.BigDataNames),
BigDataSizes: copyStringInt64Map(i.BigDataSizes),
BigDataDigests: copyStringDigestMap(i.BigDataDigests),
Created: i.Created,
Flags: copyStringInterfaceMap(i.Flags),
}
}
func (r *imageStore) Images() ([]Image, error) {
images := make([]Image, len(r.images))
for i := range r.images {
images[i] = *(r.images[i])
images[i] = *copyImage(r.images[i])
}
return images, nil
}
@ -343,7 +358,7 @@ func (r *imageStore) Create(id string, names []string, layer, metadata string, c
}
err = r.Save()
}
return image, err
return copyImage(image), err
}
func (r *imageStore) Metadata(id string) (string, error) {
@ -450,7 +465,7 @@ func (r *imageStore) Delete(id string) error {
func (r *imageStore) Get(id string) (*Image, error) {
if image, ok := r.lookup(id); ok {
return image, nil
return copyImage(image), nil
}
return nil, ErrImageUnknown
}
@ -546,7 +561,7 @@ func (r *imageStore) BigDataNames(id string) ([]string, error) {
if !ok {
return nil, ErrImageUnknown
}
return image.BigDataNames, nil
return copyStringSlice(image.BigDataNames), nil
}
func imageSliceWithoutValue(slice []*Image, value *Image) []*Image {