|
|
@ -32,7 +32,19 @@ type ConsulCAProviderConfig struct {
|
|
|
|
// ConsulCAProviderConfig.
|
|
|
|
// ConsulCAProviderConfig.
|
|
|
|
func ParseConsulCAConfig(raw map[string]interface{}) (*ConsulCAProviderConfig, error) {
|
|
|
|
func ParseConsulCAConfig(raw map[string]interface{}) (*ConsulCAProviderConfig, error) {
|
|
|
|
var config ConsulCAProviderConfig
|
|
|
|
var config ConsulCAProviderConfig
|
|
|
|
if err := mapstructure.WeakDecode(raw, &config); err != nil {
|
|
|
|
decodeConf := &mapstructure.DecoderConfig{
|
|
|
|
|
|
|
|
DecodeHook: mapstructure.StringToTimeDurationHookFunc(),
|
|
|
|
|
|
|
|
ErrorUnused: true,
|
|
|
|
|
|
|
|
Result: &config,
|
|
|
|
|
|
|
|
WeaklyTypedInput: true,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
decoder, err := mapstructure.NewDecoder(decodeConf)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return nil, err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err := decoder.Decode(raw); err != nil {
|
|
|
|
return nil, fmt.Errorf("error decoding config: %s", err)
|
|
|
|
return nil, fmt.Errorf("error decoding config: %s", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|