working_docker_image?: Modify behavior to match spec

This commit is contained in:
Sebastian Serth
2018-02-22 01:03:06 +01:00
parent 2a38db6e75
commit e70897e560

View File

@ -47,7 +47,7 @@ class ExecutionEnvironment < ActiveRecord::Base
private :validate_docker_image?
def working_docker_image?
DockerClient.pull(docker_image) unless DockerClient.image_tags.include?(docker_image)
DockerClient.pull(docker_image) unless DockerClient.find_image_by_tag(docker_image).blank?
output = DockerClient.new(execution_environment: self).execute_arbitrary_command(VALIDATION_COMMAND)
errors.add(:docker_image, "error: #{output[:stderr]}") if output[:stderr].present?
rescue DockerClient::Error => error