Skip to content

Commit 6825528

Browse files
authored
Merge pull request #111 from ekristen/fix-filter-group
fix(filter): default group
2 parents 2da1117 + 84cb9c1 commit 6825528

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/filter/filter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ func (f *Filter) UnmarshalYAML(unmarshal func(interface{}) error) error {
308308
if unmarshal(&value) == nil {
309309
f.Type = Exact
310310
f.Value = value
311+
f.Group = "default"
311312
return nil
312313
}
313314

@@ -378,6 +379,7 @@ func NewExactFilter(value string) Filter {
378379
return Filter{
379380
Type: Exact,
380381
Value: value,
382+
Group: "default",
381383
}
382384
}
383385

pkg/filter/filter_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ func TestFilter_NewExactFilter(t *testing.T) {
485485
f := filter.NewExactFilter("testing")
486486

487487
assert.Equal(t, f.Type, filter.Exact)
488+
assert.Equal(t, f.Group, "default")
488489

489490
b1, err := f.Match("testing")
490491
assert.NoError(t, err)
@@ -523,6 +524,7 @@ func TestFilter_Validation(t *testing.T) {
523524
if tc.error {
524525
assert.Error(t, errValidate)
525526
} else {
527+
assert.Equal(t, "default", f.Group)
526528
assert.NoError(t, errValidate)
527529
}
528530
})

0 commit comments

Comments
 (0)