Ver Fonte

dont restart container unless new hash

reid há 2 anos atrás
pai
commit
f5ea0eabf3
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      docker/docker.go

+ 2 - 0
docker/docker.go

@@ -200,6 +200,8 @@ func StartContainer(containerName string, containerType string) (structs.Contain
 		// if container is running, check the image tag
 		// if container is running, check the image tag
 		currentImage := existingContainer.Image
 		currentImage := existingContainer.Image
 		currentTag := strings.Split(currentImage, ":")[1]
 		currentTag := strings.Split(currentImage, ":")[1]
+		logger.Info(fmt.Sprintf("DEBUG: Current image: %s, Current tag: %s, Desired tag: %s, Current ID: %s, Desired ID: %s", 
+		currentImage, currentTag, desiredTag, existingContainer.ImageID, desiredHash))
 		logger.Info(fmt.Sprintf("New %s image: %s@sha256:%s", containerType, desiredTag, desiredHash))
 		logger.Info(fmt.Sprintf("New %s image: %s@sha256:%s", containerType, desiredTag, desiredHash))
 		if currentTag != desiredTag || existingContainer.ImageID != desiredHash {
 		if currentTag != desiredTag || existingContainer.ImageID != desiredHash {
 			// if the hashes don't match, recreate the container with the new one
 			// if the hashes don't match, recreate the container with the new one