Skip to content

Commit

Permalink
vendor: remove unuse vendor package github.com/imdario/mergo
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Wan <zirenwan@gmail.com>
  • Loading branch information
HusterWan committed Oct 14, 2018
1 parent 267b2c3 commit cd51345
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 832 deletions.
11 changes: 7 additions & 4 deletions daemon/mgr/container_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ func (mgr *ContainerManager) Upgrade(ctx context.Context, name string, config *t
}

func (mgr *ContainerManager) prepareContainerEntrypointForUpgrade(ctx context.Context, c *Container, config *types.ContainerUpgradeConfig) error {
// first, use the entrypoint specified by ContainerUpgradeConfig
// Firstly, try to use the entrypoint specified by ContainerUpgradeConfig
if len(config.Entrypoint) > 0 {
return nil
}

// secondly, use the entrypoint of the old container
// Secondly, try to use the entrypoint of the old container.
// because of the entrypoints of old container's CreateConfig and old image being merged,
// we cannot decide the old container's entrypoint belongs which, so just check if the old
// so we cannot decide which config that the old container's entrypoint belongs to, so just check if the old
// container's entrypoint is different with the old image.
c.Lock()
defer c.Unlock()
Expand All @@ -121,6 +121,9 @@ func (mgr *ContainerManager) prepareContainerEntrypointForUpgrade(ctx context.Co
if err != nil {
return err
}

// if the entrypoints of old container and the old image is empty, we should use to CMD of old container,
// else if entrypoints are different, we use the CMD of old container.
if (c.Config.Entrypoint == nil && oldImgConfig.Entrypoint == nil) || !utils.StringSliceEqual(c.Config.Entrypoint, oldImgConfig.Entrypoint) {
config.Entrypoint = c.Config.Entrypoint
if len(config.Cmd) == 0 {
Expand All @@ -130,7 +133,7 @@ func (mgr *ContainerManager) prepareContainerEntrypointForUpgrade(ctx context.Co
return nil
}

// thirdly, use the entrypoint of the new image
// Thirdly, just use the entrypoint of the new image
newImgConfig, err := mgr.ImageMgr.GetOCIImageConfig(ctx, config.Image)
if err != nil {
return err
Expand Down
46 changes: 0 additions & 46 deletions vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md

This file was deleted.

28 changes: 0 additions & 28 deletions vendor/github.com/imdario/mergo/LICENSE

This file was deleted.

219 changes: 0 additions & 219 deletions vendor/github.com/imdario/mergo/README.md

This file was deleted.

44 changes: 0 additions & 44 deletions vendor/github.com/imdario/mergo/doc.go

This file was deleted.

Loading

0 comments on commit cd51345

Please sign in to comment.