Get rid of similar `CheckType` and `CheckDefinition` structs
Open
theme/internal-cleanup
type/enhancement
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
The root cause of https://github.com/hashicorp/consul/pull/3178 was that we have similar structs and copy between them, and we skipped a couple fields. We added a band-aid unit test to make sure we don't forget to copy something in the future, but we should just use a single struct to avoid this issue altogether.
These structs are used in the config of services (and it's different for a single check vs. a check along with a service), the agent API, and they are saved as JSON when we persist check state in the data dir, so we need to be careful with this refactor and add some tests to make sure we don't break reading old persisted checks or the API.
Contributor guide
Assessment
This issue has not been assessed yet.