Bump github.com/containers/storage from 1.16.1 to 1.16.2

Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.16.1 to 1.16.2.
- [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.16.1...v1.16.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
dependabot-preview[bot]
2020-03-09 09:33:18 +00:00
committed by Valentin Rothberg
parent 14e9834d55
commit 406d3eb134
12 changed files with 95 additions and 158 deletions

View File

@@ -2320,24 +2320,53 @@ func (s *store) DeleteContainer(id string) error {
if rcstore.Exists(id) {
if container, err := rcstore.Get(id); err == nil {
errChan := make(chan error)
var wg sync.WaitGroup
if rlstore.Exists(container.LayerID) {
if err = rlstore.Delete(container.LayerID); err != nil {
return err
}
}
if err = rcstore.Delete(id); err != nil {
return err
wg.Add(1)
go func() {
errChan <- rlstore.Delete(container.LayerID)
wg.Done()
}()
}
wg.Add(1)
go func() {
errChan <- rcstore.Delete(id)
wg.Done()
}()
middleDir := s.graphDriverName + "-containers"
gcpath := filepath.Join(s.GraphRoot(), middleDir, container.ID)
if err = os.RemoveAll(gcpath); err != nil {
return err
}
wg.Add(1)
go func() {
errChan <- os.RemoveAll(gcpath)
wg.Done()
}()
rcpath := filepath.Join(s.RunRoot(), middleDir, container.ID)
if err = os.RemoveAll(rcpath); err != nil {
return err
wg.Add(1)
go func() {
errChan <- os.RemoveAll(rcpath)
wg.Done()
}()
go func() {
wg.Wait()
close(errChan)
}()
for {
select {
case err, ok := <-errChan:
if !ok {
return nil
}
if err != nil {
return err
}
}
}
return nil
}
}
return ErrNotAContainer