From b38670513c20ce44c47d7b59e596105e23393a8b Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Thu, 7 Jan 2021 13:20:48 -0600 Subject: [PATCH] consul/connect: fix panic during in-place upgrade with connect jobs When upgrading from Nomad v0.12.x to v1.0.x, Nomad client will panic on startup if the node is running Connect enabled jobs. This is caused by a missing piece of plumbing of the Consul Proxies API interface during the client restore process. Fixes #9738 --- CHANGELOG.md | 1 + client/client.go | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8776288d331..936dd7070cdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ BUG FIXES: * consul: Fixed a bug where updating a task to include services would not work [[GH-9707](https://github.com/hashicorp/nomad/issues/9707)] * consul: Fixed alloc address mode port advertisement to use the mapped `to` port value [[GH-9730](https://github.com/hashicorp/nomad/issues/9730)] * consul/connect: Fixed a bug where absent ingress envoy proxy configuration could panic client [[GH-9669](https://github.com/hashicorp/nomad/issues/9669)] + * consul/connect: Fixed a bug where in-place upgrade of Nomad client running Connect enabled jobs would panic [[GH-9738](https://github.com/hashicorp/nomad/issues/9738)] * template: Fixed multiple issues in template src/dest and artifact dest interpolation [[GH-9671](https://github.com/hashicorp/nomad/issues/9671)] * template: Fixed a bug where dynamic secrets did not trigger the template `change_mode` after a client restart. [[GH-9636](https://github.com/hashicorp/nomad/issues/9636)] * server: Fixed a bug where new servers may bootstrap prematurely when configured with `bootstrap_expect = 0`. diff --git a/client/client.go b/client/client.go index 911c1d5e677e..a1cce6651e2f 100644 --- a/client/client.go +++ b/client/client.go @@ -1105,6 +1105,7 @@ func (c *Client) restoreState() error { DeviceStatsReporter: c, Consul: c.consulService, ConsulSI: c.tokensClient, + ConsulProxies: c.consulProxies, Vault: c.vaultClient, PrevAllocWatcher: prevAllocWatcher, PrevAllocMigrator: prevAllocMigrator,