File tree Expand file tree Collapse file tree 6 files changed +4
-16
lines changed Expand file tree Collapse file tree 6 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ func (d *gauge) Unmarshal(parser *confmap.Conf) error {
125
125
if err := d .MetricValueType .Unmarshal (parser ); err != nil {
126
126
return err
127
127
}
128
- return parser .Unmarshal (d )
128
+ return parser .Unmarshal (d , confmap . WithIgnoreUnused () )
129
129
}
130
130
131
131
func (d gauge ) Type () string {
@@ -155,7 +155,7 @@ func (d *sum) Unmarshal(parser *confmap.Conf) error {
155
155
if err := d .MetricValueType .Unmarshal (parser ); err != nil {
156
156
return err
157
157
}
158
- return parser .Unmarshal (d )
158
+ return parser .Unmarshal (d , confmap . WithIgnoreUnused () )
159
159
}
160
160
161
161
// TODO: Currently, this func will not be called because of https://github.com/open-telemetry/opentelemetry-collector/issues/6671. Uncomment function and
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ func (c *Config) Unmarshal(component *confmap.Conf) error {
107
107
}
108
108
109
109
builder := builderFunc ()
110
- if err := component .Unmarshal (builder ); err != nil {
110
+ if err := component .Unmarshal (builder , confmap . WithIgnoreUnused () ); err != nil {
111
111
return fmt .Errorf ("unmarshal to %s: %w" , typeString , err )
112
112
}
113
113
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ type TimeParser struct {
48
48
// Unmarshal starting from default settings
49
49
func (t * TimeParser ) Unmarshal (component * confmap.Conf ) error {
50
50
cfg := NewTimeParser ()
51
- err := component .Unmarshal (& cfg )
51
+ err := component .Unmarshal (& cfg , confmap . WithIgnoreUnused () )
52
52
if err != nil {
53
53
return err
54
54
}
Original file line number Diff line number Diff line change @@ -35,10 +35,6 @@ func TestConfig(t *testing.T) {
35
35
return cfg
36
36
}(),
37
37
},
38
- {
39
- Name : "no_nested" ,
40
- ExpectErr : true ,
41
- },
42
38
},
43
39
}.Run (t )
44
40
}
Original file line number Diff line number Diff line change @@ -46,10 +46,6 @@ func TestUnmarshal(t *testing.T) {
46
46
return cfg
47
47
}(),
48
48
},
49
- {
50
- Name : "no_nested" ,
51
- ExpectErr : true ,
52
- },
53
49
},
54
50
}.Run (t )
55
51
}
Original file line number Diff line number Diff line change @@ -49,10 +49,6 @@ func TestUnmarshal(t *testing.T) {
49
49
return cfg
50
50
}(),
51
51
},
52
- {
53
- Name : "no_nested" ,
54
- ExpectErr : true ,
55
- },
56
52
},
57
53
}.Run (t )
58
54
}
You can’t perform that action at this time.
0 commit comments