Should register container/sandbox name after restart.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
9015b6ec68
commit
e132f9c1ea
@ -65,6 +65,9 @@ func (c *criContainerdService) recover(ctx context.Context) error {
|
|||||||
if err := c.sandboxStore.Add(sb); err != nil {
|
if err := c.sandboxStore.Add(sb); err != nil {
|
||||||
return fmt.Errorf("failed to add sandbox %q to store: %v", sandbox.ID(), err)
|
return fmt.Errorf("failed to add sandbox %q to store: %v", sandbox.ID(), err)
|
||||||
}
|
}
|
||||||
|
if err := c.sandboxNameIndex.Reserve(sb.Name, sb.ID); err != nil {
|
||||||
|
return fmt.Errorf("failed to reserve sandbox name %q: %v", sb.Name, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recover all containers.
|
// Recover all containers.
|
||||||
@ -83,6 +86,9 @@ func (c *criContainerdService) recover(ctx context.Context) error {
|
|||||||
if err := c.containerStore.Add(cntr); err != nil {
|
if err := c.containerStore.Add(cntr); err != nil {
|
||||||
return fmt.Errorf("failed to add container %q to store: %v", container.ID(), err)
|
return fmt.Errorf("failed to add container %q to store: %v", container.ID(), err)
|
||||||
}
|
}
|
||||||
|
if err := c.containerNameIndex.Reserve(cntr.Name, cntr.ID); err != nil {
|
||||||
|
return fmt.Errorf("failed to reserve container name %q: %v", cntr.Name, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recover all images.
|
// Recover all images.
|
||||||
|
Loading…
Reference in New Issue
Block a user