2019-06-06 19:18:45 +00:00
|
|
|
# New `jobspec` Entry Checklist
|
|
|
|
|
|
|
|
## Code
|
|
|
|
|
2020-12-15 20:38:33 +00:00
|
|
|
* [ ] Consider similar features in Consul, Kubernetes, and other tools. Is there prior art we should match? Terminology, structure, etc?
|
2019-06-12 22:35:48 +00:00
|
|
|
* [ ] Add structs/fields to `api/` package
|
2020-12-15 20:38:33 +00:00
|
|
|
* `api/` structs usually have Canonicalize and Copy methods
|
|
|
|
* New fields should be added to existing Canonicalize, Copy methods
|
|
|
|
* Test the structs/fields via methods mentioned above
|
2019-06-12 22:35:48 +00:00
|
|
|
* [ ] Add structs/fields to `nomad/structs` package
|
2020-12-15 20:38:33 +00:00
|
|
|
* `structs/` structs usually have Copy, Equals, and Validate methods
|
|
|
|
* Validation happens in this package and _must_ be implemented
|
2020-04-10 23:44:19 +00:00
|
|
|
* Note that analogous struct field names should match with `api/` package
|
2020-12-15 20:38:33 +00:00
|
|
|
* Test the structs/fields via methods mentioned above
|
|
|
|
* Implement and test other logical methods
|
2019-06-12 22:35:48 +00:00
|
|
|
* [ ] Add conversion between `api/` and `nomad/structs` in `command/agent/job_endpoint.go`
|
2020-12-15 20:38:33 +00:00
|
|
|
* Add test for conversion
|
|
|
|
* [ ] Implement diff logic for new structs/fields in `nomad/structs/diff.go`
|
2020-03-25 15:33:27 +00:00
|
|
|
* Note that fields must be listed in alphabetical order in `FieldDiff` slices in `nomad/structs/diff_test.go`
|
2020-12-15 20:38:33 +00:00
|
|
|
* Add test for diff of new structs/fields
|
|
|
|
* [ ] Add change detection for new structs/feilds in `scheduler/util.go/tasksUpdated`
|
|
|
|
* Might be covered by `.Equals` but might not be, check.
|
|
|
|
* Should return true if the task must be replaced as a result of the change.
|
2019-06-06 19:18:45 +00:00
|
|
|
|
2020-11-30 15:46:40 +00:00
|
|
|
## HCL1 (deprecated)
|
|
|
|
|
|
|
|
New jobspec entries should only be added to `jobspec2`. It makes use of HCL2
|
|
|
|
and the `api` package for automatic parsing. Before, additional parsing was
|
|
|
|
required in the original `jobspec` package.
|
|
|
|
|
|
|
|
* [ ] ~~Parse in `jobspec/parse.go`~~ (HCL1 only)
|
|
|
|
* [ ] ~~Test in `jobspec/parse_test.go` (preferably with a
|
|
|
|
`jobspec/text-fixtures/<feature>.hcl` test file)~~ (HCL1 only)
|
|
|
|
|
2019-06-06 19:18:45 +00:00
|
|
|
## Docs
|
|
|
|
|
2019-06-12 22:35:48 +00:00
|
|
|
* [ ] Changelog
|
|
|
|
* [ ] Jobspec entry https://www.nomadproject.io/docs/job-specification/index.html
|
2019-10-08 17:55:53 +00:00
|
|
|
* [ ] Jobspec sidebar entry https://github.com/hashicorp/nomad/blob/master/website/source/layouts/docs.erb
|
2019-06-12 22:35:48 +00:00
|
|
|
* [ ] Job JSON API entry https://www.nomadproject.io/api/json-jobs.html
|
|
|
|
* [ ] Sample Response output in API https://www.nomadproject.io/api/jobs.html
|
|
|
|
* [ ] Consider if it needs a guide https://www.nomadproject.io/guides/index.html
|