From 141623e835a29eaa7927062fa3d5a13551ab23f2 Mon Sep 17 00:00:00 2001 From: timfeirg Date: Tue, 11 Apr 2017 19:50:21 +0800 Subject: [PATCH] remove container from etcd only if container is successfully removed --- cluster/calcium/remove_container.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cluster/calcium/remove_container.go b/cluster/calcium/remove_container.go index 324049ce1..bf5e3b0f5 100644 --- a/cluster/calcium/remove_container.go +++ b/cluster/calcium/remove_container.go @@ -143,9 +143,7 @@ func (c *calcium) removeOneContainer(container *types.Container, info enginetype return } } - //TODO 记录操作日志 c.store.UpdateNodeMem(node.Podname, node.Name, container.Memory, "+") - c.store.RemoveContainer(info.ID) }() // before stop @@ -169,5 +167,6 @@ func (c *calcium) removeOneContainer(container *types.Container, info enginetype log.Errorf("Error during ContainerRemove: %s", err.Error()) return err } + c.store.RemoveContainer(info.ID) return nil }