7b99d9a25d
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. |
||
---|---|---|
.. | ||
agent_limits.go | ||
agent_limits_test.go | ||
builder.go | ||
builder_oss.go | ||
builder_oss_test.go | ||
config.go | ||
config_oss.go | ||
default.go | ||
default_oss.go | ||
doc.go | ||
flags.go | ||
flags_test.go | ||
flagset.go | ||
limits.go | ||
limits_windows.go | ||
merge.go | ||
merge_test.go | ||
runtime.go | ||
runtime_oss.go | ||
runtime_oss_test.go | ||
runtime_test.go | ||
segment_oss.go | ||
segment_oss_test.go |