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

Backport of config: fix client.template config merging with defaults into release/1.7.x #20170

Merged

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #20165 to be assessed for backporting due to the inclusion of the label backport/1.7.x.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@tgross
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/nomad/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


When loading the client configuration, the user-specified client.template block was not properly merged with the default values. As a result, if the user set any client.template field, all the other field defaulted to their zero values instead of the documented defaults.

This changeset:

  • Adds the missing Merge method for the client template config and ensures it's called.
  • Makes a single source of truth for the default template configuration, instead of two different constructors.
  • Extends the tests to cover the merge of a partial block better.

Fixes: #20164


Overview of commits

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 20, 2024

CLA assistant check
All committers have signed the CLA.

When loading the client configuration, the user-specified `client.template`
block was not properly merged with the default values. As a result, if the user
set any `client.template` field, all the other field defaulted to their zero
values instead of the documented defaults.

This changeset:
* Adds the missing `Merge` method for the client template config and ensures
  it's called.
* Makes a single source of truth for the default template configuration,
  instead of two different constructors.
* Extends the tests to cover the merge of a partial block better.

Fixes: #20164
@tgross tgross marked this pull request as ready for review March 20, 2024 14:28
@tgross tgross merged commit ffdfd6d into release/1.7.x Mar 20, 2024
19 checks passed
@tgross tgross deleted the backport/b-config-template-merge/humbly-relaxing-raven branch March 20, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants