Skip to content

Commit

Permalink
fix podname problem
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed Aug 28, 2018
1 parent 61f7980 commit 351de58
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cluster/calcium/replace_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ func (c *Calcium) ReplaceContainer(ctx context.Context, opts *types.DeployOption
ib := newImageBucket()
defer wg.Wait()
for index, oldContainer := range oldContainers {
if opts.Podname != "" && oldContainer.Podname != opts.Podname {
log.Debugf("[ReplaceContainer] Skip not in pod container %s", oldContainer.ID)
continue
}
log.Debugf("[ReplaceContainer] Replace old container %s", oldContainer.ID)
wg.Add(1)
go func(deployOpts types.DeployOptions, oldContainer *types.Container, index int) {
Expand Down Expand Up @@ -89,6 +93,9 @@ func (c *Calcium) doReplaceContainer(
return nil, removeMessage, err
}

// 覆盖 podname 如果做全量更新的话
opts.Podname = container.Podname

// 记录镜像
if ib != nil {
ib.Add(container.Podname, containerJSON.Config.Image)
Expand Down

0 comments on commit 351de58

Please sign in to comment.