open-consul/agent/config
Daniel Nephin 7b99d9a25d config: add HookWeakDecodeFromSlice
Currently opaque config blocks (config entries, and CA provider config) are
modified by PatchSliceOfMaps, making it impossible for these opaque
config sections to contain slices of maps.

In order to fix this problem, any lazy-decoding of these blocks needs to support
weak decoding of []map[string]interface{} to a struct type before
PatchSliceOfMaps is replaces. This is necessary because these config
blobs are persisted, and during an upgrade an older version of Consul
could read one of the new configuration values, which would cause an error.

To support the upgrade path, this commit first introduces the new hooks
for weak decoding of []map[string]interface{} and uses them only in the
lazy-decode paths. That way, in a future release, new style
configuration will be supported by the older version of Consul.

This decode hook has a number of advantages:

1. It no longer panics. It allows mapstructure to report the error
2. It no longer requires the user to declare which fields are slices of
   structs. It can deduce that information from the 'to' value.
3. It will make it possible to preserve opaque configuration, allowing
   for structured opaque config.
2020-06-08 17:05:09 -04:00
..
agent_limits.go config: validate system limits against limits.http_max_conns_per_client (#7434) 2020-04-02 09:22:17 +02:00
agent_limits_test.go config: validate system limits against limits.http_max_conns_per_client (#7434) 2020-04-02 09:22:17 +02:00
builder.go acl: remove the deprecated acl_enforce_version_8 option (#7991) 2020-05-29 16:16:03 -05:00
builder_oss.go agent/config: include Audit struct as a pointer on Config, fix tests 2020-05-11 14:13:05 -07:00
builder_oss_test.go Update enterprise configurations to be in OSS 2020-05-04 10:21:05 -04:00
config.go config: add HookWeakDecodeFromSlice 2020-06-08 17:05:09 -04:00
config_oss.go agent/config: add auditing config to OSS and add to enterpriseConfigMap exclusions 2020-05-11 13:27:35 -07:00
default.go acl: remove the deprecated acl_enforce_version_8 option (#7991) 2020-05-29 16:16:03 -05:00
default_oss.go OSS changes to allow for parsing the enterprise DNS config prop… (#6959) 2019-12-18 10:16:35 -05:00
doc.go Metrics service prefix (#3498) 2017-09-26 17:49:55 -07:00
flags.go Allow to restrict servers that can join a given Serf Consul cluster. (#7628) 2020-05-20 11:31:19 +02:00
flags_test.go Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
flagset.go New config parser, HCL support, multiple bind addrs (#3480) 2017-09-25 11:40:42 -07:00
limits.go Add unconvert linter 2020-05-12 13:47:25 -04:00
limits_windows.go config: validate system limits against limits.http_max_conns_per_client (#7434) 2020-04-02 09:22:17 +02:00
merge.go Changes maps to merge vs. overwrite when processing configs. 2017-12-13 16:06:01 -08:00
merge_test.go Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
runtime.go acl: remove the deprecated acl_enforce_version_8 option (#7991) 2020-05-29 16:16:03 -05:00
runtime_oss.go Sync of OSS changes to support namespaces (#6909) 2019-12-09 21:26:41 -05:00
runtime_oss_test.go Update enterprise configurations to be in OSS 2020-05-04 10:21:05 -04:00
runtime_test.go Replace goe/verify.Values with testify/require.Equal (#7993) 2020-06-02 12:41:25 -04:00
segment_oss.go Update to use a consulent build tag instead of just ent (#5759) 2019-05-01 11:11:27 -04:00
segment_oss_test.go Update enterprise configurations to be in OSS 2020-05-04 10:21:05 -04:00