File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -900,6 +900,7 @@ func (c *ntmConfig) AllSettingsBySource() map[model.Source]interface{} {
900900 model .SourceLocalConfigProcess : c .localConfigProcess .DumpSettings (func (model.Source ) bool { return true }),
901901 model .SourceRC : c .remoteConfig .DumpSettings (func (model.Source ) bool { return true }),
902902 model .SourceCLI : c .cli .DumpSettings (func (model.Source ) bool { return true }),
903+ model .SourceProvided : c .root .DumpSettings (func (src model.Source ) bool { return src != model .SourceDefault }),
903904 }
904905}
905906
Original file line number Diff line number Diff line change @@ -315,6 +315,7 @@ func TestAllSettingsBySource(t *testing.T) {
315315 cfg .SetDefault ("a" , 0 )
316316 cfg .SetDefault ("b.c" , 0 )
317317 cfg .SetDefault ("b.d" , 0 )
318+ cfg .SetDefault ("x" , 123 )
318319 cfg .BuildSchema ()
319320
320321 cfg .ReadConfig (strings .NewReader ("a: 987" ))
@@ -327,6 +328,7 @@ func TestAllSettingsBySource(t *testing.T) {
327328 "c" : 0 ,
328329 "d" : 0 ,
329330 },
331+ "x" : 123 ,
330332 },
331333 model .SourceUnknown : map [string ]interface {}{},
332334 model .SourceFile : map [string ]interface {}{
@@ -342,6 +344,12 @@ func TestAllSettingsBySource(t *testing.T) {
342344 model .SourceLocalConfigProcess : map [string ]interface {}{},
343345 model .SourceRC : map [string ]interface {}{},
344346 model .SourceCLI : map [string ]interface {}{},
347+ model .SourceProvided : map [string ]interface {}{
348+ "a" : 987 ,
349+ "b" : map [string ]interface {}{
350+ "c" : 123 ,
351+ },
352+ },
345353 }
346354 assert .Equal (t , expected , cfg .AllSettingsBySource ())
347355}
You can’t perform that action at this time.
0 commit comments