Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error parsing config when setting consul.timeout. #6907

Merged
merged 1 commit into from
Jan 7, 2020

Conversation

jrasell
Copy link
Member

@jrasell jrasell commented Jan 7, 2020

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.

closes #6893

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.
@tgross tgross self-requested a review January 7, 2020 16:58
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @jrasell!

It looks like this got introduced in ae7a8da and while there are some other examples of this config parsing w/ time.Duration in that commit, this is the only one where we have this kind of accidental shadowing happen.

@tgross tgross merged commit bbf0bdb into hashicorp:master Jan 7, 2020
@tgross tgross added this to the 0.10.3 milestone Jan 7, 2020
tgross added a commit that referenced this pull request Jan 7, 2020
@jrasell jrasell deleted the gh-6893 branch January 7, 2020 18:46
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consul config under nomad configuration doesn't accept timeout property in any format
2 participants