Expand renumber to also renumber pod locks

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon 2019-02-14 17:55:54 -05:00
parent a3dbb7a837
commit 9353a3e8ec
1 changed files with 17 additions and 0 deletions

View File

@ -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