mirror of https://github.com/status-im/consul.git
75cbbe2702
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. |
||
---|---|---|
.. | ||
decode | ||
file | ||
semaphore | ||
stringslice | ||
cluster.go | ||
cluster_test.go | ||
eof.go | ||
json.go | ||
map_walker.go | ||
map_walker_test.go | ||
math.go | ||
math_test.go | ||
path.go | ||
rand.go | ||
retry.go | ||
retry_test.go | ||
rtt.go | ||
rtt_test.go | ||
serf.go | ||
stop_context.go | ||
telemetry.go | ||
telemetry_test.go | ||
testing_httpserver.go | ||
translate.go | ||
translate_test.go | ||
useragent.go | ||
useragent_test.go | ||
uuid.go |