mirror of https://github.com/status-im/consul.git
Fall back to using old fields when marshaling
Co-Authored-By: kyhavlov <kylehav@gmail.com>
This commit is contained in:
parent
1a4978fb94
commit
1885cf78f6
|
@ -77,12 +77,18 @@ func (d *HealthCheckDefinition) MarshalJSON() ([]byte, error) {
|
||||||
|
|
||||||
if d.IntervalDuration != 0 {
|
if d.IntervalDuration != 0 {
|
||||||
out.Interval = d.IntervalDuration.String()
|
out.Interval = d.IntervalDuration.String()
|
||||||
|
} else if d.Interval != 0 {
|
||||||
|
out.Interval = d.Interval.String()
|
||||||
}
|
}
|
||||||
if d.TimeoutDuration != 0 {
|
if d.TimeoutDuration != 0 {
|
||||||
out.Timeout = d.TimeoutDuration.String()
|
out.Timeout = d.TimeoutDuration.String()
|
||||||
|
} else if d.Timeout != 0 {
|
||||||
|
out.Timeout = d.Timeout.String()
|
||||||
}
|
}
|
||||||
if d.DeregisterCriticalServiceAfterDuration != 0 {
|
if d.DeregisterCriticalServiceAfterDuration != 0 {
|
||||||
out.DeregisterCriticalServiceAfter = d.DeregisterCriticalServiceAfterDuration.String()
|
out.DeregisterCriticalServiceAfter = d.DeregisterCriticalServiceAfterDuration.String()
|
||||||
|
} else if d.DeregisterCriticalServiceAfter != 0 {
|
||||||
|
out.DeregisterCriticalServiceAfter = d.DeregisterCriticalServiceAfter.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(out)
|
return json.Marshal(out)
|
||||||
|
|
Loading…
Reference in New Issue