hashicorp / hashicorp/consul

Get rid of similar `CheckType` and `CheckDefinition` structs

Open
#3,179 0 comments 0 reactions 1 assignee Claimed by @magiconair View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.