diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-02-14 17:55:54 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-02-21 10:51:42 -0500 |
commit | 9353a3e8ec3855f29c552dd1e0134dbaa3031efa (patch) | |
tree | 071af2a20551d7f7310dbafdfa0ff1894dfbd2d2 | |
parent | a3dbb7a837f0c6fe9e12aec6da3778759632f7d1 (diff) | |
download | podman-9353a3e8ec3855f29c552dd1e0134dbaa3031efa.tar.gz podman-9353a3e8ec3855f29c552dd1e0134dbaa3031efa.tar.bz2 podman-9353a3e8ec3855f29c552dd1e0134dbaa3031efa.zip |
Expand renumber to also renumber pod locks
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
-rw-r--r-- | libpod/runtime_renumber.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libpod/runtime_renumber.go b/libpod/runtime_renumber.go index bc291156e..b27b5f1a8 100644 --- a/libpod/runtime_renumber.go +++ b/libpod/runtime_renumber.go @@ -52,6 +52,23 @@ func (r *Runtime) RenumberLocks() error { return err } } + allPods, err := r.state.AllPods() + if err != nil { + return err + } + for _, pod := range allPods { + lock, err := r.lockManager.AllocateLock() + if err != nil { + return errors.Wrapf(err, "error allocating lock for pod %s", pod.ID()) + } + + pod.config.LockID = lock.ID() + + // Write the new lock ID + if err := r.state.RewritePodConfig(pod, pod.config); err != nil { + return err + } + } r.lock.Unlock() locked = false |