- combine app and pod constraint validation rules
- fix CLUSTER constraint validation
- unit tests for SchedulingValidation
- fix documentation for CLUSTER constraints
Details
- Reviewers
aquamatthias sascala timcharper jenkins • jasongilanfarr meichstedt - Commits
- rMARATHON656108f84a6f: cluster constraint should accept hostname field without a value
rMARATHONa23133456a67: cluster constraint should accept hostname field without a value
rMARATHON3e6a2dafef2b: cluster constraint should accept hostname field without a value - JIRA Issues
- JIRA MARATHON-7182 CLUSTER w/ hostname field and no value (incorrectly) fails validation
- sbt test
Diff Detail
- Repository
- rMARATHON marathon
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
I wonder if it's worth writing an integration test that validates the behavior of the CLUSTER operator as part of this ticket?
Build has FAILED
Link to build: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1999/
See console output for more information: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/1999/console
um .. this is interesting: it appears that CLUSTER doesn't require a value at all, regardless of field: https://github.com/mesosphere/marathon/blob/5495479035facdcca05d6b58c6c09a0413c02c34/src/main/scala/mesosphere/mesos/Constraints.scala#L114
- rMARATHON53f5169268d0 correct documentation for CLUSTER constraint
- rMARATHON3ce41e3aaf83 value is completely optional for CLUSTER
Build has FAILED
Link to build: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/2000/
See console output for more information: https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/2000/console
docs/docs/constraints.md | ||
---|---|---|
68 | You can also tie an app to a specific node... |
Build is green https://jenkins.mesosphere.com/service/jenkins/job/public-test-marathon-phabricator/2002/ for more details.
Nice!
src/main/scala/mesosphere/marathon/api/v2/validation/SchedulingValidation.scala | ||
---|---|---|
57 | "Missing field" could be a constant as well. |
src/main/scala/mesosphere/marathon/api/v2/validation/SchedulingValidation.scala | ||
---|---|---|
57 | agreed, there are a bunch of validation messages scattered over the codebase that could be formalized. i've been formalizing the ones that are referenced in the new test cases that I'm writing. i'll leave this one alone, refactoring it will be an exercise for a future validation unit test refactoring effort |
Little edits and one question.
docs/docs/constraints.md | ||
---|---|---|
33 | comma after specified, remove "then" | |
36 | commas around "for example" | |
38 | suggest: "The <hostname> field tells Marathon that the launched tasks of the app or pod should be launched together on the same agent." Unless this is a term of art, I'm not sure that "have affinity for each other" is precise enough language to be useful to a user. Which element of the example below is hostname? | |
39 | When a value for <hostname> is specified, tasks are launched..." | |
40 | When the <hostname> value is empty or unspecified, the first...." | |
43 | When attribute fields are specified, tasks... | |
44 | When attribute fields are empty or unspecified, the first... | |
46 | ExamplesThe example below specifies the exact rack on which to run app tasks: | |
57 | This example leaves the attribute field empty. This tells Marathon that all of the app tasks should run on the same rack, but does not specify which. | |
68 | This example specifies that an app <!-- or pod? --> must run on a specific node. | |
79 | Below, the attribute field is empty. This tells Marathon that all app tasks must run on the same node, but does not specify which. |
comma after specified, remove "then"