From 1885cf78f63d24b52b4718cfdcdde91b0b104b89 Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Mon, 28 Jan 2019 08:47:26 -0800 Subject: [PATCH] Fall back to using old fields when marshaling Co-Authored-By: kyhavlov --- api/health.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/health.go b/api/health.go index 5f717ff4fc..9faf6b665a 100644 --- a/api/health.go +++ b/api/health.go @@ -77,12 +77,18 @@ func (d *HealthCheckDefinition) MarshalJSON() ([]byte, error) { if d.IntervalDuration != 0 { out.Interval = d.IntervalDuration.String() + } else if d.Interval != 0 { + out.Interval = d.Interval.String() } if d.TimeoutDuration != 0 { out.Timeout = d.TimeoutDuration.String() + } else if d.Timeout != 0 { + out.Timeout = d.Timeout.String() } if d.DeregisterCriticalServiceAfterDuration != 0 { out.DeregisterCriticalServiceAfter = d.DeregisterCriticalServiceAfterDuration.String() + } else if d.DeregisterCriticalServiceAfter != 0 { + out.DeregisterCriticalServiceAfter = d.DeregisterCriticalServiceAfter.String() } return json.Marshal(out)