Skip to content

Commit

Permalink
Add decode hooks to other parse functions
Browse files Browse the repository at this point in the history
Now that the original config parsing leaves the opaque maps unmodified
these secondary decodes must use the hooks to normalize fields.
  • Loading branch information
dnephin committed May 27, 2020
1 parent a8e5656 commit d1d9d8a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions agent/structs/connect_proxy_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,6 @@ type ExposePath struct {
ParsedFromCheck bool
}

// TODO: this is most likely not used. The API type is the one to be deserialized
// with JSON
func (t *ExposePath) UnmarshalJSON(data []byte) (err error) {
type Alias ExposePath
aux := &struct {
Expand Down
1 change: 0 additions & 1 deletion agent/xds/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type ProxyConfig struct {
// allows caller to choose whether and how to report the error.
func ParseProxyConfig(m map[string]interface{}) (ProxyConfig, error) {
var cfg ProxyConfig
err := mapstructure.WeakDecode(m, &cfg)
decodeConf := &mapstructure.DecoderConfig{
DecodeHook: mapstructure.ComposeDecodeHookFunc(
decode.HookWeakDecodeFromSlice,
Expand Down

0 comments on commit d1d9d8a

Please sign in to comment.