From 88da39a95b07761e2d4ae074400f8c2a61dcb372 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Tue, 7 Jan 2020 16:46:18 +0100 Subject: [PATCH] Fix error parsing config when setting consul.timeout. When parsing a config file which had the consul.timeout param set, Nomad was reporting an error causing startup to fail. This seems to be caused by the HCL decoder interpreting the timeout type as an int rather than a string. This is caused by the struct TimeoutHCL param having a hcl key of timeout alongside a Timeout struct param of type time.Duration (int). Ensuring the decoder ignores the Timeout struct param ensure the decoder runs correctly. --- nomad/structs/config/consul.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nomad/structs/config/consul.go b/nomad/structs/config/consul.go index 97fa6afc260..a5df0762201 100644 --- a/nomad/structs/config/consul.go +++ b/nomad/structs/config/consul.go @@ -65,8 +65,8 @@ type ConsulConfig struct { GRPCAddr string `hcl:"grpc_address"` // Timeout is used by Consul HTTP Client - Timeout time.Duration - TimeoutHCL string `hcl:"timeout" json:"-"` + Timeout time.Duration `hcl:"-"` + TimeoutHCL string `hcl:"timeout" json:"-"` // Token is used to provide a per-request ACL token. This options overrides // the agent's default token