Skip to content

Commit 5f9f5b1

Browse files
committed
BUG/MINOR: consul: fix health_check_policy validation on update
1 parent f43f82e commit 5f9f5b1

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
@@ -141,7 +141,7 @@ func (c *ReplaceConsulHandlerImpl) Handle(params service_discovery.ReplaceConsul
141141
return service_discovery.NewReplaceConsulDefault(int(*e.Code)).WithPayload(e)
142142
}
143143
setFilters(params.Data)
144-
if *params.Data.HealthCheckPolicy == models.ConsulHealthCheckPolicyMin && params.Data.HealthCheckPolicyMin <= 0 {
144+
if params.Data.HealthCheckPolicy != nil && *params.Data.HealthCheckPolicy == models.ConsulHealthCheckPolicyMin && params.Data.HealthCheckPolicyMin <= 0 {
145145
e := &models.Error{
146146
Message: misc.StringP("health_check_policy_min is required for 'min' health_check_policy"),
147147
Code: misc.Int64P(int(misc.ErrHTTPBadRequest)),

0 commit comments

Comments
 (0)