Details
-
Task
-
Status: Resolved
-
Major
-
Resolution: Implemented
-
None
-
None
-
Mesosphere Sprint 33
-
2
Description
We should not put this logic directly into the 'Resources::validate()' function.
The primary reason is that the existing 'Resources::validate()' function doesn't consider the semantics of any particular resource when performing its validation (it only makes sure that the fields in the 'Resource' protobuf message are correctly formed). Since a fractional 'gpus' resources is actually well-formed (and only semantically incorrect), we should push this validation logic up into the master.
Moreover, the existing logic to construct a 'Resources' object from a 'RepeatedPtrField<Resource>' silently drops any resources that don't pass 'Resources::validate()'. This means that if we were to push the non-fractional 'gpus' validation into 'Resources::validate()', the 'gpus' resources would just be silently dropped rather than causing a TASK_ERROR in the master. This is obviously not the desired behaviour.