From 127736d916de0011d5da8f7fb13d8a177cac87f4 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 a2e4d5163c6..386fe49b985 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,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 911c1d5e677..a1cce6651e2 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,