api: Add Notes field to service checks (#22397)

Co-authored-by: Piotr Kazmierczak <470696+pkazmierczak@users.noreply.github.com>
This commit is contained in:
nicoche
2024-06-10 16:59:49 +02:00
committed by GitHub
parent 1c976d126e
commit ffcb72bfe3
10 changed files with 60 additions and 0 deletions

View File

@@ -1624,6 +1624,7 @@ func ApiServicesToStructs(in []*api.Service, group bool) []*structs.Service {
Interval: check.Interval,
Timeout: check.Timeout,
InitialStatus: check.InitialStatus,
Notes: check.Notes,
TLSServerName: check.TLSServerName,
TLSSkipVerify: check.TLSSkipVerify,
Header: check.Header,

View File

@@ -2729,6 +2729,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
Interval: 4 * time.Second,
Timeout: 2 * time.Second,
InitialStatus: "ok",
Notes: "this is a check",
CheckRestart: &api.CheckRestart{
Limit: 3,
IgnoreWarnings: true,
@@ -2838,6 +2839,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
Interval: 4 * time.Second,
Timeout: 2 * time.Second,
InitialStatus: "ok",
Notes: "this is a check",
SuccessBeforePassing: 3,
FailuresBeforeCritical: 4,
FailuresBeforeWarning: 2,
@@ -3163,6 +3165,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
Interval: 4 * time.Second,
Timeout: 2 * time.Second,
InitialStatus: "ok",
Notes: "this is a check",
CheckRestart: &structs.CheckRestart{
Grace: 11 * time.Second,
Limit: 3,
@@ -3274,6 +3277,7 @@ func TestJobs_ApiJobToStructsJob(t *testing.T) {
Interval: 4 * time.Second,
Timeout: 2 * time.Second,
InitialStatus: "ok",
Notes: "this is a check",
GRPCService: "foo.Bar",
GRPCUseTLS: true,
SuccessBeforePassing: 3,