diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-18 21:27:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-18 21:27:00 +0200 |
commit | fe48b9e036dc1a05294b2bb3df5d9b23256c6c55 (patch) | |
tree | aac86a655dbb1a6ab3438b471bece21ad205e81b | |
parent | 8133aa1ee88cea2c89d38c1c56974c8889ef0933 (diff) | |
parent | 518d59182eef09254a5c3df30d8af61c5f445c80 (diff) | |
download | podman-fe48b9e036dc1a05294b2bb3df5d9b23256c6c55.tar.gz podman-fe48b9e036dc1a05294b2bb3df5d9b23256c6c55.tar.bz2 podman-fe48b9e036dc1a05294b2bb3df5d9b23256c6c55.zip |
Merge pull request #4045 from umohnani8/vendor
Vendor c/storage 1.13.3
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | vendor/github.com/containers/storage/Makefile | 1 | ||||
-rw-r--r-- | vendor/github.com/containers/storage/VERSION | 2 | ||||
-rw-r--r-- | vendor/github.com/containers/storage/images.go | 30 | ||||
-rw-r--r-- | vendor/github.com/containers/storage/layers.go | 71 | ||||
-rw-r--r-- | vendor/github.com/containers/storage/store.go | 10 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
8 files changed, 68 insertions, 52 deletions
@@ -17,7 +17,7 @@ require ( github.com/containers/conmon v0.3.0 // indirect github.com/containers/image v3.0.2+incompatible github.com/containers/psgo v1.3.1 - github.com/containers/storage v1.13.2 + github.com/containers/storage v1.13.3 github.com/coreos/bbolt v1.3.3 // indirect github.com/coreos/etcd v3.3.13+incompatible // indirect github.com/coreos/go-iptables v0.4.2 // indirect @@ -108,6 +108,8 @@ github.com/containers/storage v1.13.1 h1:rjVirLS9fCGkUFlLDZEoGDDUugtIf46DufWvJu0 github.com/containers/storage v1.13.1/go.mod h1:6D8nK2sU9V7nEmAraINRs88ZEscM5C5DK+8Npp27GeA= github.com/containers/storage v1.13.2 h1:UXZ0Ckmk6+6+4vj2M2ywruVtH97pnRoAhTG8ctd+yQI= github.com/containers/storage v1.13.2/go.mod h1:6D8nK2sU9V7nEmAraINRs88ZEscM5C5DK+8Npp27GeA= +github.com/containers/storage v1.13.3 h1:9EzTXZXG/8SGD9MnkSCe/jLq3QldcE1QlgW7vePEsjw= +github.com/containers/storage v1.13.3/go.mod h1:6D8nK2sU9V7nEmAraINRs88ZEscM5C5DK+8Npp27GeA= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= diff --git a/vendor/github.com/containers/storage/Makefile b/vendor/github.com/containers/storage/Makefile index bb1de007b..fa0fddaeb 100644 --- a/vendor/github.com/containers/storage/Makefile +++ b/vendor/github.com/containers/storage/Makefile @@ -1,4 +1,5 @@ export GO111MODULE=off +export GOPROXY=https://proxy.golang.org .PHONY: \ all \ diff --git a/vendor/github.com/containers/storage/VERSION b/vendor/github.com/containers/storage/VERSION index 065f9ec4c..01b756823 100644 --- a/vendor/github.com/containers/storage/VERSION +++ b/vendor/github.com/containers/storage/VERSION @@ -1 +1 @@ -1.13.3-dev +1.13.3 diff --git a/vendor/github.com/containers/storage/images.go b/vendor/github.com/containers/storage/images.go index b1df9b765..5d6a2e48d 100644 --- a/vendor/github.com/containers/storage/images.go +++ b/vendor/github.com/containers/storage/images.go @@ -372,7 +372,7 @@ func (r *imageStore) ClearFlag(id string, flag string) error { } image, ok := r.lookup(id) if !ok { - return ErrImageUnknown + return errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } delete(image.Flags, flag) return r.Save() @@ -384,7 +384,7 @@ func (r *imageStore) SetFlag(id string, flag string, value interface{}) error { } image, ok := r.lookup(id) if !ok { - return ErrImageUnknown + return errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } if image.Flags == nil { image.Flags = make(map[string]interface{}) @@ -456,14 +456,14 @@ func (r *imageStore) addMappedTopLayer(id, layer string) error { image.MappedTopLayers = append(image.MappedTopLayers, layer) return r.Save() } - return ErrImageUnknown + return errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (r *imageStore) Metadata(id string) (string, error) { if image, ok := r.lookup(id); ok { return image.Metadata, nil } - return "", ErrImageUnknown + return "", errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (r *imageStore) SetMetadata(id, metadata string) error { @@ -474,7 +474,7 @@ func (r *imageStore) SetMetadata(id, metadata string) error { image.Metadata = metadata return r.Save() } - return ErrImageUnknown + return errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (r *imageStore) removeName(image *Image, name string) { @@ -499,7 +499,7 @@ func (r *imageStore) SetNames(id string, names []string) error { image.Names = names return r.Save() } - return ErrImageUnknown + return errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (r *imageStore) Delete(id string) error { @@ -508,7 +508,7 @@ func (r *imageStore) Delete(id string) error { } image, ok := r.lookup(id) if !ok { - return ErrImageUnknown + return errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } id = image.ID toDeleteIndex := -1 @@ -551,14 +551,14 @@ func (r *imageStore) Get(id string) (*Image, error) { if image, ok := r.lookup(id); ok { return copyImage(image), nil } - return nil, ErrImageUnknown + return nil, errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (r *imageStore) Lookup(name string) (id string, err error) { if image, ok := r.lookup(name); ok { return image.ID, nil } - return "", ErrImageUnknown + return "", errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (r *imageStore) Exists(id string) bool { @@ -570,7 +570,7 @@ func (r *imageStore) ByDigest(d digest.Digest) ([]*Image, error) { if images, ok := r.bydigest[d]; ok { return copyImageSlice(images), nil } - return nil, ErrImageUnknown + return nil, errors.Wrapf(ErrImageUnknown, "error locating image with digest %q", d) } func (r *imageStore) BigData(id, key string) ([]byte, error) { @@ -579,7 +579,7 @@ func (r *imageStore) BigData(id, key string) ([]byte, error) { } image, ok := r.lookup(id) if !ok { - return nil, ErrImageUnknown + return nil, errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } return ioutil.ReadFile(r.datapath(image.ID, key)) } @@ -590,7 +590,7 @@ func (r *imageStore) BigDataSize(id, key string) (int64, error) { } image, ok := r.lookup(id) if !ok { - return -1, ErrImageUnknown + return -1, errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } if image.BigDataSizes == nil { image.BigDataSizes = make(map[string]int64) @@ -610,7 +610,7 @@ func (r *imageStore) BigDataDigest(id, key string) (digest.Digest, error) { } image, ok := r.lookup(id) if !ok { - return "", ErrImageUnknown + return "", errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } if image.BigDataDigests == nil { image.BigDataDigests = make(map[string]digest.Digest) @@ -624,7 +624,7 @@ func (r *imageStore) BigDataDigest(id, key string) (digest.Digest, error) { func (r *imageStore) BigDataNames(id string) ([]string, error) { image, ok := r.lookup(id) if !ok { - return nil, ErrImageUnknown + return nil, errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } return copyStringSlice(image.BigDataNames), nil } @@ -649,7 +649,7 @@ func (r *imageStore) SetBigData(id, key string, data []byte, digestManifest func } image, ok := r.lookup(id) if !ok { - return ErrImageUnknown + return errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } err := os.MkdirAll(r.datadir(image.ID), 0700) if err != nil { diff --git a/vendor/github.com/containers/storage/layers.go b/vendor/github.com/containers/storage/layers.go index d746ba061..ac905b0b4 100644 --- a/vendor/github.com/containers/storage/layers.go +++ b/vendor/github.com/containers/storage/layers.go @@ -363,7 +363,7 @@ func (r *layerStore) Load() error { } if cleanup, ok := layer.Flags[incompleteFlag]; ok { if b, ok := cleanup.(bool); ok && b { - err = r.Delete(layer.ID) + err = r.deleteInternal(layer.ID) if err != nil { break } @@ -372,7 +372,7 @@ func (r *layerStore) Load() error { } } if shouldSave { - return r.Save() + return r.saveLayers() } } return err @@ -416,6 +416,16 @@ func (r *layerStore) loadMounts() error { } func (r *layerStore) Save() error { + r.mountsLockfile.Lock() + defer r.mountsLockfile.Unlock() + defer r.mountsLockfile.Touch() + if err := r.saveLayers(); err != nil { + return err + } + return r.saveMounts() +} + +func (r *layerStore) saveLayers() error { if !r.IsReadWrite() { return errors.Wrapf(ErrStoreIsReadOnly, "not allowed to modify the layer store at %q", r.layerspath()) } @@ -431,13 +441,7 @@ func (r *layerStore) Save() error { return err } defer r.Touch() - if err := ioutils.AtomicWriteFile(rpath, jldata, 0600); err != nil { - return err - } - r.mountsLockfile.Lock() - defer r.mountsLockfile.Unlock() - defer r.mountsLockfile.Touch() - return r.saveMounts() + return ioutils.AtomicWriteFile(rpath, jldata, 0600) } func (r *layerStore) saveMounts() error { @@ -954,7 +958,7 @@ func (r *layerStore) tspath(id string) string { return filepath.Join(r.layerdir, id+tarSplitSuffix) } -func (r *layerStore) Delete(id string) error { +func (r *layerStore) deleteInternal(id string) error { if !r.IsReadWrite() { return errors.Wrapf(ErrStoreIsReadOnly, "not allowed to delete layers at %q", r.layerspath()) } @@ -963,23 +967,7 @@ func (r *layerStore) Delete(id string) error { return ErrLayerUnknown } id = layer.ID - // The layer may already have been explicitly unmounted, but if not, we - // should try to clean that up before we start deleting anything at the - // driver level. - mountCount, err := r.Mounted(id) - if err != nil { - return errors.Wrapf(err, "error checking if layer %q is still mounted", id) - } - for mountCount > 0 { - if _, err := r.Unmount(id, false); err != nil { - return err - } - mountCount, err = r.Mounted(id) - if err != nil { - return errors.Wrapf(err, "error checking if layer %q is still mounted", id) - } - } - err = r.driver.Remove(id) + err := r.driver.Remove(id) if err == nil { os.Remove(r.tspath(id)) delete(r.byid, id) @@ -1015,11 +1003,36 @@ func (r *layerStore) Delete(id string) error { label.ReleaseLabel(mountLabel) } } - if err = r.Save(); err != nil { + } + return err +} + +func (r *layerStore) Delete(id string) error { + layer, ok := r.lookup(id) + if !ok { + return ErrLayerUnknown + } + id = layer.ID + // The layer may already have been explicitly unmounted, but if not, we + // should try to clean that up before we start deleting anything at the + // driver level. + mountCount, err := r.Mounted(id) + if err != nil { + return errors.Wrapf(err, "error checking if layer %q is still mounted", id) + } + for mountCount > 0 { + if _, err := r.Unmount(id, false); err != nil { return err } + mountCount, err = r.Mounted(id) + if err != nil { + return errors.Wrapf(err, "error checking if layer %q is still mounted", id) + } } - return err + if err := r.deleteInternal(id); err != nil { + return err + } + return r.Save() } func (r *layerStore) Lookup(name string) (id string, err error) { diff --git a/vendor/github.com/containers/storage/store.go b/vendor/github.com/containers/storage/store.go index 74275482b..dd3405212 100644 --- a/vendor/github.com/containers/storage/store.go +++ b/vendor/github.com/containers/storage/store.go @@ -1202,7 +1202,7 @@ func (s *store) CreateContainer(id string, names []string, image, layer, metadat } } if cimage == nil { - return nil, ErrImageUnknown + return nil, errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } imageID = cimage.ID @@ -1437,7 +1437,7 @@ func (s *store) ListImageBigData(id string) ([]string, error) { return bigDataNames, err } } - return nil, ErrImageUnknown + return nil, errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (s *store) ImageBigDataSize(id, key string) (int64, error) { @@ -1516,7 +1516,7 @@ func (s *store) ImageBigData(id, key string) ([]byte, error) { return data, nil } } - return nil, ErrImageUnknown + return nil, errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (s *store) SetImageBigData(id, key string, data []byte, digestManifest func([]byte) (digest.Digest, error)) error { @@ -2891,7 +2891,7 @@ func (s *store) Image(id string) (*Image, error) { return image, nil } } - return nil, ErrImageUnknown + return nil, errors.Wrapf(ErrImageUnknown, "error locating image with ID %q", id) } func (s *store) ImagesByTopLayer(id string) ([]*Image, error) { @@ -2953,7 +2953,7 @@ func (s *store) ImagesByDigest(d digest.Digest) ([]*Image, error) { } } imageList, err := store.ByDigest(d) - if err != nil && err != ErrImageUnknown { + if err != nil && errors.Cause(err) != ErrImageUnknown { return nil, err } images = append(images, imageList...) diff --git a/vendor/modules.txt b/vendor/modules.txt index 1de9fede0..3a27eea12 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -109,7 +109,7 @@ github.com/containers/psgo/internal/dev github.com/containers/psgo/internal/proc github.com/containers/psgo/internal/process github.com/containers/psgo/internal/host -# github.com/containers/storage v1.13.2 +# github.com/containers/storage v1.13.3 github.com/containers/storage github.com/containers/storage/pkg/archive github.com/containers/storage/pkg/chrootarchive |