From bbf0bdbb2a491b0225fcd522e40b8c898ec0fc58 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Tue, 7 Jan 2020 19:40:55 +0100 Subject: [PATCH] Fix error parsing config when setting consul.timeout. (#6907) 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