19 lines
		
	
	
		
			348 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			348 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| require "commands/image"
 | |
| 
 | |
| module Validators
 | |
|   class DeployEnv::Image < Base
 | |
|     include ::ImageCommands
 | |
| 
 | |
|     def valid?
 | |
|       images = get_images(::Devops::Db.connector, @model.provider)
 | |
|       images.detect do |image|
 | |
|         image["id"] == @model.image
 | |
|       end
 | |
|     end
 | |
| 
 | |
|     def message
 | |
|       "Invalid image '#{@model.image}'."
 | |
|     end
 | |
|   end
 | |
| end
 | 
