Class: UffizziCore::TemplateService
- Inherits:
-
Object
- Object
- UffizziCore::TemplateService
- Defined in:
- app/services/uffizzi_core/template_service.rb
Class Method Summary collapse
- .valid_containers_memory_limit?(template) ⇒ Boolean
- .valid_containers_memory_request?(template) ⇒ Boolean
Class Method Details
.valid_containers_memory_limit?(template) ⇒ Boolean
5 6 7 8 9 10 11 |
# File 'app/services/uffizzi_core/template_service.rb', line 5 def valid_containers_memory_limit?(template) containers_attributes = template.payload['containers_attributes'] container_memory_limit = template.project.account.container_memory_limit return true if container_memory_limit.nil? containers_attributes.all? { |container| container['memory_limit'].to_i <= container_memory_limit } end |
.valid_containers_memory_request?(template) ⇒ Boolean
13 14 15 16 17 18 19 |
# File 'app/services/uffizzi_core/template_service.rb', line 13 def valid_containers_memory_request?(template) containers_attributes = template.payload['containers_attributes'] container_memory_limit = template.project.account.container_memory_limit return true if container_memory_limit.nil? containers_attributes.all? { |container| container['memory_request'].to_i <= container_memory_limit } end |