consul/command
Daniel Nephin 75cbbe2702 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
..
acl acl: allow auth methods created in the primary datacenter to optionally create global tokens (#7899) 2020-06-01 11:44:47 -05:00
agent Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
catalog Convert the remaining calls to NewTestAgentWithFields 2020-03-31 17:14:55 -04:00
config config: add HookWeakDecodeFromSlice 2020-06-08 17:05:09 -04:00
connect ci: Add staticcheck and fix most errors 2020-05-28 11:59:58 -04:00
debug Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
event Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
exec Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
flags cli: fix typo in -namespace help text (#7225) 2020-02-05 14:43:25 -06:00
forceleave Convert the remaining calls to NewTestAgentWithFields 2020-03-31 17:14:55 -04:00
helpers Centralized Config CLI (#5731) 2019-04-30 16:27:16 -07:00
info Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
intention Replace whitelist/blacklist terminology with allowlist/denylist (#7971) 2020-05-29 14:19:16 -04:00
join Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
keygen Update default gossip encryption key size to 32 bytes 2019-07-30 09:45:41 -06:00
keyring Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
kv Add unconvert linter 2020-05-12 13:47:25 -04:00
leave Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
lock Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
login acl: add auth method for JWTs (#7846) 2020-05-11 20:59:29 -05:00
logout Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
maint Add unconvert linter 2020-05-12 13:47:25 -04:00
members Convert the remaining calls to NewTestAgentWithFields 2020-03-31 17:14:55 -04:00
monitor Rename NewTestAgentWithFields to StartTestAgent 2020-03-31 17:14:55 -04:00
operator Convert the remaining calls to NewTestAgentWithFields 2020-03-31 17:14:55 -04:00
reload Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
rtt Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
services Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
snapshot fix some flaky snapshot tests (#8015) 2020-06-03 14:18:52 -05:00
tls docs: fix filenames (#7453) 2020-03-17 21:00:45 +01:00
validate Move internal/ to sdk/ (#5568) 2019-03-27 08:54:56 -04:00
version acl: remove the deprecated `acl_enforce_version_8` option (#7991) 2020-05-29 16:16:03 -05:00
watch Remove name from NewTestAgent 2020-03-31 16:13:44 -04:00
commands_oss.go bug: Consul lock does not receive signals if lock not acquired (#5909) 2020-01-22 12:44:48 -07:00
registry.go Abandon daemonize for simpler solution (preserving history): 2018-06-25 12:24:10 -07:00