Commit 10130a17 authored by duanjinfei's avatar duanjinfei

stop container

parent 7cd93bc3
...@@ -661,7 +661,8 @@ func (t *TaskHandler) checkIsStopContainer(taskCmd *models.TaskCmd) { ...@@ -661,7 +661,8 @@ func (t *TaskHandler) checkIsStopContainer(taskCmd *models.TaskCmd) {
if len(split) == 1 { if len(split) == 1 {
container.Image = fmt.Sprintf("%s:%s", container.Image, "latest") container.Image = fmt.Sprintf("%s:%s", container.Image, "latest")
} }
if container.Image == taskCmd.ImageName && container.State == "running" { log.WithField("containerImageName", container.Image).WithField("oldTaskImageName", oldTaskImageName).Info("match image")
if container.Image == oldTaskImageName && container.State == "running" {
t.DockerOp.StopContainer(container.ID) t.DockerOp.StopContainer(container.ID)
log.WithField("Image name", container.Image).Info("Stopping container") log.WithField("Image name", container.Image).Info("Stopping container")
break break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment