mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-08-27 00:37:20 +00:00
add multiline redactor test
This commit is contained in:
@@ -202,6 +202,41 @@ another line here`,
|
||||
want: map[string]string{
|
||||
"data/datacollectorname": `abc 123
|
||||
another line here
|
||||
`,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "custom multiline redactor",
|
||||
Collect: &troubleshootv1beta1.Collect{
|
||||
Data: &troubleshootv1beta1.Data{
|
||||
CollectorMeta: troubleshootv1beta1.CollectorMeta{
|
||||
CollectorName: "datacollectorname",
|
||||
Exclude: multitype.BoolOrString{},
|
||||
},
|
||||
Name: "data",
|
||||
Data: `xyz123
|
||||
abc
|
||||
xyz123
|
||||
xyz123
|
||||
abc`,
|
||||
},
|
||||
},
|
||||
Redactors: []*troubleshootv1beta1.Redact{
|
||||
{
|
||||
MultiLine: []troubleshootv1beta1.MultiLine{
|
||||
{
|
||||
Selector: "abc",
|
||||
Redactor: "xyz(123)",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
want: map[string]string{
|
||||
"data/datacollectorname": `xyz123
|
||||
abc
|
||||
123
|
||||
xyz123
|
||||
abc
|
||||
`,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user