Skip to content

Commit

Permalink
Add grace period to toplevel checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dangra committed Mar 1, 2023
1 parent b0deba3 commit 0aa0f9c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/appv2/definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func TestToDefinition(t *testing.T) {
"type": "http",
"interval": "10s",
"timeout": "2s",
"grace_period": "27s",
"method": "GET",
"path": "/status",
"protocol": "https",
Expand Down
1 change: 1 addition & 0 deletions internal/appv2/serde_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ func TestLoadTOMLAppConfigReferenceFormat(t *testing.T) {
Type: api.Pointer("http"),
Interval: mustParseDuration("10s"),
Timeout: mustParseDuration("2s"),
GracePeriod: mustParseDuration("27s"),
HTTPMethod: api.Pointer("GET"),
HTTPPath: api.Pointer("/status"),
HTTPProtocol: api.Pointer("https"),
Expand Down
1 change: 1 addition & 0 deletions internal/appv2/testdata/full-reference.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ primary_region = "sea"
type = "http"
interval = "10s"
timeout = "2s"
grace_period = "27s"
method = "GET"
path = "/status"
protocol = "https"
Expand Down
3 changes: 3 additions & 0 deletions internal/appv2/toplevelcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ToplevelCheck struct {
Type *string `json:"type,omitempty" toml:"type,omitempty"`
Interval *api.Duration `json:"interval,omitempty" toml:"interval,omitempty"`
Timeout *api.Duration `json:"timeout,omitempty" toml:"timeout,omitempty"`
GracePeriod *api.Duration `json:"grace_period,omitempty" toml:"grace_period,omitempty"`
HTTPMethod *string `json:"method,omitempty" toml:"method,omitempty"`
HTTPPath *string `json:"path,omitempty" toml:"path,omitempty"`
HTTPProtocol *string `json:"protocol,omitempty" toml:"protocol,omitempty"`
Expand All @@ -37,6 +38,7 @@ func topLevelCheckFromMachineCheck(mc api.MachineCheck) *ToplevelCheck {
Type: mc.Type,
Interval: mc.Interval,
Timeout: mc.Timeout,
GracePeriod: mc.GracePeriod,
HTTPMethod: mc.HTTPMethod,
HTTPPath: mc.HTTPPath,
HTTPProtocol: mc.HTTPProtocol,
Expand All @@ -55,6 +57,7 @@ func (chk *ToplevelCheck) toMachineCheck() (*api.MachineCheck, error) {
Port: chk.Port,
Interval: chk.Interval,
Timeout: chk.Timeout,
GracePeriod: chk.GracePeriod,
HTTPPath: chk.HTTPPath,
HTTPProtocol: chk.HTTPProtocol,
HTTPSkipTLSVerify: chk.HTTPTLSSkipVerify,
Expand Down

0 comments on commit 0aa0f9c

Please sign in to comment.