consul_config: Remove default values #447
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We don't need to set these defaults values because:
These default values are rendered to the
consul.json
config file only if an appropriate argument was called in theconsul_config
resource source code. For example, currently we haveverify_incoming
andverify_outgoing
always rendered in the config file because they are called here: https://github.com/johnbellone/consul-cookbook/blob/master/libraries/consul_config.rb#L208Consul 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.