Kaynağa Gözat

dont restart container unless new hash

reid 2 yıl önce
ebeveyn
işleme
792099c662
1 değiştirilmiş dosya ile 0 ekleme ve 3 silme
  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)
 		}
 	}