Skip to content

Commit

Permalink
Backport of consul: handle nil multierror pointer correctly into rele…
Browse files Browse the repository at this point in the history
…ase/1.9.x (#24516)

Co-authored-by: Tim Gross <[email protected]>
  • Loading branch information
hc-github-team-nomad-core and tgross authored Nov 20, 2024
1 parent e405392 commit 824ce0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/24513.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
consul: Fixed a bug where failures when syncing Consul checks could panic the Nomad agent
```
2 changes: 1 addition & 1 deletion command/agent/consul/service_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ func (c *ServiceClient) sync(reason syncReason) error {
if err != nil {
metrics.IncrCounter([]string{"client", "consul", "sync_failure"}, 1)
err = fmt.Errorf("failed to query Consul checks: %w", err)
if mErr.Len() == 0 {
if mErr == nil || mErr.Len() == 0 {
return err
} else {
mErr = multierror.Append(mErr, err)
Expand Down

0 comments on commit 824ce0c

Please sign in to comment.