Bump github.com/containers/common from 0.37.0 to 0.37.1

Bumps [github.com/containers/common](https://github.com/containers/common) from 0.37.0 to 0.37.1.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](https://github.com/containers/common/compare/v0.37.0...v0.37.1)

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2021-05-03 10:48:29 +00:00
committed by GitHub
parent 2eb35e7af9
commit 5a594bff65
14 changed files with 304 additions and 35 deletions

View File

@@ -2115,6 +2115,37 @@ func (s *store) SetNames(id string, names []string) error {
return ristore.SetNames(id, deduped)
}
// Check is id refers to a RO Store
ristores, err := s.ROImageStores()
if err != nil {
return err
}
for _, s := range ristores {
store := s
store.RLock()
defer store.Unlock()
if modified, err := store.Modified(); modified || err != nil {
if err = store.Load(); err != nil {
return err
}
}
if i, err := store.Get(id); err == nil {
// Unlock R/O lock and lock with R/W lock
// Previous defer.Unlock() will free the new lock.
ristore.Unlock()
ristore.Lock()
if len(deduped) > 1 {
// Do not want to create image name in R/W storage
deduped = deduped[1:]
}
_, err := ristore.Create(id, deduped, i.TopLayer, i.Metadata, i.Created, i.Digest)
if err == nil {
return ristore.Save()
}
return err
}
}
rcstore, err := s.ContainerStore()
if err != nil {
return err