mirror of
https://github.com/prometheus/prometheus
synced 2025-04-18 21:26:04 +00:00
fix(discovery): adjust how type is retrieved in Configs' MarshalYAML/UnmarshalYAML
Signed-off-by: machine424 <ayoubmrini424@gmail.com>
This commit is contained in:
parent
97f3219157
commit
b5569c4070
@ -109,7 +109,7 @@ func (c *Configs) SetDirectory(dir string) {
|
||||
|
||||
// UnmarshalYAML implements yaml.Unmarshaler.
|
||||
func (c *Configs) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
cfgTyp := getConfigType(configsType)
|
||||
cfgTyp := reflect.StructOf(configFields)
|
||||
cfgPtr := reflect.New(cfgTyp)
|
||||
cfgVal := cfgPtr.Elem()
|
||||
|
||||
@ -124,7 +124,7 @@ func (c *Configs) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
|
||||
// MarshalYAML implements yaml.Marshaler.
|
||||
func (c Configs) MarshalYAML() (interface{}, error) {
|
||||
cfgTyp := getConfigType(configsType)
|
||||
cfgTyp := reflect.StructOf(configFields)
|
||||
cfgPtr := reflect.New(cfgTyp)
|
||||
cfgVal := cfgPtr.Elem()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user