fluke/devops-service/db/validators/deploy_env/image.rb

19 lines
383 B
Ruby
Raw Normal View History

2014-11-27 18:45:35 +03:00
require "commands/image"
module Validators
class DeployEnv::Image < Base
include ::ImageCommands
def valid?
2015-11-03 11:46:54 +03:00
return true unless @model.image
2016-01-20 17:47:07 +03:00
get_available_provider_images(::Devops::Db.connector, @model.provider).detect do |image|
2014-11-27 18:45:35 +03:00
image["id"] == @model.image
end
end
def message
"Invalid image '#{@model.image}'."
end
end
2015-02-18 11:00:24 +03:00
end