Skip to content

Commit

Permalink
remove multiple times will change resource incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Jul 10, 2018
1 parent 67a8a2b commit 973bb13
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cluster/calcium/remove_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,18 @@ func (c *Calcium) RemoveContainer(ctx context.Context, IDs []string, force bool)

// remove one container
func (c *Calcium) removeOneContainer(ctx context.Context, container *types.Container) error {
var err error
defer func() {
// not deal with raw res container
if container.RawResource {
return
}

if err != nil {
log.Errorf("[removeOneContainer] Remove container failed, we have to check it manually %v", err)
return
}

log.Debugf("[removeOneContainer] Restore node %s resource cpu: %v mem: %v", container.Nodename, container.CPU, container.Memory)
if err := c.store.UpdateNodeResource(ctx, container.Podname, container.Nodename, container.CPU, container.Memory, "+"); err != nil {
log.Errorf("[removeOneContainer] Update Node resource failed %v", err)
Expand Down

0 comments on commit 973bb13

Please sign in to comment.