浏览代码

dont restart container unless new hash

reid 2 年之前
父节点
当前提交
792099c662
共有 1 个文件被更改,包括 0 次插入3 次删除
  1. 0 3
      docker/docker.go

+ 0 - 3
docker/docker.go

@@ -204,8 +204,6 @@ func StartContainer(containerName string, containerType string) (structs.Contain
 		if len(digestParts) > 1 {
 			currentDigest = digestParts[1]
 		}
-		logger.Info(fmt.Sprintf("Current image: %s, Current digest: %s, Desired digest: %s", 
-			currentImage, currentDigest, desiredHash))
 		if currentDigest != desiredHash {
 			// if the hashes don't match, recreate the container with the new one
 			err := cli.ContainerRemove(ctx, containerName, types.ContainerRemoveOptions{Force: true})
@@ -225,7 +223,6 @@ func StartContainer(containerName string, containerType string) (structs.Contain
 			msg := fmt.Sprintf("Restarted %s with image %s", containerName, desiredImage)
 			logger.Info(msg)
 		} else {
-			msg := fmt.Sprintf("%s is already running with the correct tag: %s", containerName, desiredTag)
 			logger.Info(msg)
 		}
 	}