Skip to content

Commit ec1624b

Browse files
committed
rename keep_entry_all_satisfied
1 parent 5154759 commit ec1624b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Following is the supported API format for filter transformations:
162162
remove_entry_if_equal: removes the entry if the field value equals specified value
163163
remove_entry_if_not_equal: removes the entry if the field value does not equal specified value
164164
remove_entry_all_satisfied: removes the entry if all of the defined rules are satisfied
165-
keep_entry: keeps the entry if the set of rules are all satisfied
165+
keep_entry_all_satisfied: keeps the entry if the set of rules are all satisfied
166166
add_field: adds (input) field to the entry; overrides previous value if present (key=input, value=value)
167167
add_field_if_doesnt_exist: adds a field to the entry if the field does not exist
168168
add_field_if: add output field set to assignee if input field satisfies criteria from parameters field

pkg/api/transform_filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const (
4646
RemoveEntryIfEqual TransformFilterEnum = "remove_entry_if_equal" // removes the entry if the field value equals specified value
4747
RemoveEntryIfNotEqual TransformFilterEnum = "remove_entry_if_not_equal" // removes the entry if the field value does not equal specified value
4848
RemoveEntryAllSatisfied TransformFilterEnum = "remove_entry_all_satisfied" // removes the entry if all of the defined rules are satisfied
49-
KeepEntry TransformFilterEnum = "keep_entry" // keeps the entry if the set of rules are all satisfied
49+
KeepEntryAllSatisfied TransformFilterEnum = "keep_entry_all_satisfied" // keeps the entry if the set of rules are all satisfied
5050
AddField TransformFilterEnum = "add_field" // adds (input) field to the entry; overrides previous value if present (key=input, value=value)
5151
AddFieldIfDoesntExist TransformFilterEnum = "add_field_if_doesnt_exist" // adds a field to the entry if the field does not exist
5252
AddFieldIf TransformFilterEnum = "add_field_if" // add output field set to assignee if input field satisfies criteria from parameters field

pkg/pipeline/transform/transform_filter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func applyRule(entry config.GenericMap, labels map[string]string, rule *api.Tran
157157
return !isRemoveEntrySatisfied(entry, rule.RemoveEntryAllSatisfied)
158158
case api.ConditionalSampling:
159159
return sample(entry, rule.ConditionalSampling)
160-
case api.KeepEntry:
160+
case api.KeepEntryAllSatisfied:
161161
return rollSampling(rule.KeepEntrySampling) && isKeepEntrySatisfied(entry, rule.KeepEntryAllSatisfied)
162162
default:
163163
tlog.Panicf("unknown type %s for transform.Filter rule: %v", rule.Type, rule)
@@ -250,7 +250,7 @@ func NewTransformFilter(params config.StageParam) (Transformer, error) {
250250
return nil, err
251251
}
252252
for i := range params.Transform.Filter.Rules {
253-
if params.Transform.Filter.Rules[i].Type == api.KeepEntry {
253+
if params.Transform.Filter.Rules[i].Type == api.KeepEntryAllSatisfied {
254254
keepRules = append(keepRules, params.Transform.Filter.Rules[i])
255255
} else {
256256
rules = append(rules, params.Transform.Filter.Rules[i])

pkg/pipeline/transform/transform_filter_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ func Test_Transform_KeepEntry(t *testing.T) {
676676
newFilter := api.TransformFilter{
677677
Rules: []api.TransformFilterRule{
678678
{
679-
Type: api.KeepEntry,
679+
Type: api.KeepEntryAllSatisfied,
680680
KeepEntryAllSatisfied: []*api.KeepEntryRule{
681681
{
682682
Type: api.KeepEntryIfEqual,
@@ -694,7 +694,7 @@ func Test_Transform_KeepEntry(t *testing.T) {
694694
},
695695
},
696696
{
697-
Type: api.KeepEntry,
697+
Type: api.KeepEntryAllSatisfied,
698698
KeepEntryAllSatisfied: []*api.KeepEntryRule{
699699
{
700700
Type: api.KeepEntryIfRegexMatch,
@@ -742,7 +742,7 @@ func Test_Transform_KeepEntrySampling(t *testing.T) {
742742
newFilter := api.TransformFilter{
743743
Rules: []api.TransformFilterRule{
744744
{
745-
Type: api.KeepEntry,
745+
Type: api.KeepEntryAllSatisfied,
746746
KeepEntryAllSatisfied: []*api.KeepEntryRule{
747747
{
748748
Type: api.KeepEntryIfEqual,
@@ -755,7 +755,7 @@ func Test_Transform_KeepEntrySampling(t *testing.T) {
755755
KeepEntrySampling: 10,
756756
},
757757
{
758-
Type: api.KeepEntry,
758+
Type: api.KeepEntryAllSatisfied,
759759
KeepEntryAllSatisfied: []*api.KeepEntryRule{
760760
{
761761
Type: api.KeepEntryIfEqual,

0 commit comments

Comments
 (0)