Skip to content

Commit 7b0b08e

Browse files
committed
BUG/MINOR: consul: fix health_check_policy validation on update
1 parent 426517c commit 7b0b08e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

handlers/consul.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (c *ReplaceConsulHandlerImpl) Handle(params service_discovery.ReplaceConsul
139139
e := misc.HandleError(err)
140140
return service_discovery.NewReplaceConsulDefault(int(*e.Code)).WithPayload(e)
141141
}
142-
if *params.Data.HealthCheckPolicy == models.ConsulHealthCheckPolicyMin && params.Data.HealthCheckPolicyMin <= 0 {
142+
if params.Data.HealthCheckPolicy != nil && *params.Data.HealthCheckPolicy == models.ConsulHealthCheckPolicyMin && params.Data.HealthCheckPolicyMin <= 0 {
143143
e := &models.Error{
144144
Message: misc.StringP("health_check_policy_min is required for 'min' health_check_policy"),
145145
Code: misc.Int64P(int(misc.ErrHTTPBadRequest)),

0 commit comments

Comments
 (0)