sous-chefs / consul

Development repository for the consul cookbook
https://supermarket.chef.io/cookbooks/consul
Apache License 2.0
192 stars 244 forks source link

consul_config: Remove default values #447

Closed legal90 closed 7 years ago

legal90 commented 7 years ago

We don't need to set these defaults values because: 1) These default values are rendered to the consul.json config file only if an appropriate argument was called in the consul_config resource source code. For example, currently we have verify_incoming and verify_outgoing always rendered in the config file because they are called here: https://github.com/johnbellone/consul-cookbook/blob/master/libraries/consul_config.rb#L208

2) Consul can handle default values by itself. We just don't need to render them in the config file unless we really need to set them explicitly. It makes a big sense for consul config options which have different default values in different Consul agent versions. For example, acl_enforce_version_8 defaults to false in versions of Consul prior to 0.8, and defaults to true in Consul 0.8 and later.

This PR doesn't break the backward compatibility. No explicitly defined variables will be removed.

legal90 commented 7 years ago

I've fixed the spec as well. As we see, now the config file will contain only those options, which have been explicitly set by resource param and/or node's attributes ['consul']['config'][<opt_name>]

legal90 commented 7 years ago

@johnbellone Could you please disable codecov integration for Pull-Requests in this repo? We can still use it for a badge in README.md, but let's keep PRs green.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.