mirror of
https://github.com/containers/podman.git
synced 2025-08-16 04:15:29 +08:00
build(deps): bump github.com/containers/storage from 1.15.7 to 1.15.8
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.15.7 to 1.15.8. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.15.7...v1.15.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
![27856297+dependabot-preview[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
Valentin Rothberg

parent
4699d5e02d
commit
94453c85c7
47
vendor/github.com/containers/storage/layers.go
generated
vendored
47
vendor/github.com/containers/storage/layers.go
generated
vendored
@ -239,6 +239,10 @@ type LayerStore interface {
|
||||
// ApplyDiff reads a tarstream which was created by a previous call to Diff and
|
||||
// applies its changes to a specified layer.
|
||||
ApplyDiff(to string, diff io.Reader) (int64, error)
|
||||
|
||||
// LoadLocked wraps Load in a locked state. This means it loads the store
|
||||
// and cleans-up invalid layers if needed.
|
||||
LoadLocked() error
|
||||
}
|
||||
|
||||
type layerStore struct {
|
||||
@ -346,6 +350,7 @@ func (r *layerStore) Load() error {
|
||||
r.byname = names
|
||||
r.bycompressedsum = compressedsums
|
||||
r.byuncompressedsum = uncompressedsums
|
||||
|
||||
// Load and merge information about which layers are mounted, and where.
|
||||
if r.IsReadWrite() {
|
||||
r.mountsLockfile.RLock()
|
||||
@ -353,22 +358,23 @@ func (r *layerStore) Load() error {
|
||||
if err = r.loadMounts(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// Last step: if we're writable, try to remove anything that a previous
|
||||
// user of this storage area marked for deletion but didn't manage to
|
||||
// actually delete.
|
||||
if r.IsReadWrite() && r.Locked() {
|
||||
for _, layer := range r.layers {
|
||||
if layer.Flags == nil {
|
||||
layer.Flags = make(map[string]interface{})
|
||||
}
|
||||
if cleanup, ok := layer.Flags[incompleteFlag]; ok {
|
||||
if b, ok := cleanup.(bool); ok && b {
|
||||
err = r.deleteInternal(layer.ID)
|
||||
if err != nil {
|
||||
break
|
||||
|
||||
// Last step: as we’re writable, try to remove anything that a previous
|
||||
// user of this storage area marked for deletion but didn't manage to
|
||||
// actually delete.
|
||||
if r.Locked() {
|
||||
for _, layer := range r.layers {
|
||||
if layer.Flags == nil {
|
||||
layer.Flags = make(map[string]interface{})
|
||||
}
|
||||
if cleanup, ok := layer.Flags[incompleteFlag]; ok {
|
||||
if b, ok := cleanup.(bool); ok && b {
|
||||
err = r.deleteInternal(layer.ID)
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
shouldSave = true
|
||||
}
|
||||
shouldSave = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -376,9 +382,16 @@ func (r *layerStore) Load() error {
|
||||
return r.saveLayers()
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *layerStore) LoadLocked() error {
|
||||
r.lockfile.Lock()
|
||||
defer r.lockfile.Unlock()
|
||||
return r.Load()
|
||||
}
|
||||
|
||||
func (r *layerStore) loadMounts() error {
|
||||
mounts := make(map[string]*Layer)
|
||||
mpath := r.mountspath()
|
||||
@ -487,8 +500,6 @@ func (s *store) newLayerStore(rundir string, layerdir string, driver drivers.Dri
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
lockfile.Lock()
|
||||
defer lockfile.Unlock()
|
||||
mountsLockfile, err := GetLockfile(filepath.Join(rundir, "mountpoints.lock"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -516,8 +527,6 @@ func newROLayerStore(rundir string, layerdir string, driver drivers.Driver) (ROL
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
lockfile.RLock()
|
||||
defer lockfile.Unlock()
|
||||
rlstore := layerStore{
|
||||
lockfile: lockfile,
|
||||
mountsLockfile: nil,
|
||||
|
Reference in New Issue
Block a user