%w(modified_by_client_uuid container_uuid requesting_container_uuid)
end
+ def container_completed!
+ # may implement retry logic here in the future.
+ self.state = ContainerRequest::Final
+ self.save!
+ end
+
protected
def fill_field_defaults
self.runtime_constraints ||= {}
self.mounts ||= {}
self.cwd ||= "."
- self.priority ||= 1
end
# Turn a container request into a container.
errors.add :container_uuid, "has not been resolved to a container."
end
+ if priority.nil?
+ errors.add :priority, "cannot be nil"
+ end
+
# Can update priority, container count.
permitted.push :priority, :container_count_max, :container_uuid
end
when Final
+ if not current_user.andand.is_admin
+ errors.add :state, "of container request can only be set to Final by system."
+ end
+
if self.state_changed?
permitted.push :state
else