Skip to content

Commit

Permalink
Fix error parsing config when setting consul.timeout. (#6907)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jrasell authored and tgross committed Jan 7, 2020
1 parent 8e4a5f1 commit bbf0bdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nomad/structs/config/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbf0bdb

Please sign in to comment.