Fix unquoted regex bug in TeeMatcher
@@ -18,6 +18,7 @@ package sfio
import (
"fmt"
+ "regexp"
"sigs.k8s.io/kustomize/kyaml/yaml"
)
@@ -169,7 +170,7 @@ func (f TeeMatchedFilter) visitMatched(node *yaml.RNode) error {
if yaml.IsListIndex(p) && matchIndex > 0 {
matchIndex--
name, _, _ := yaml.SplitIndexNameValue(p)
- p = fmt.Sprintf("[%s=%s]", name, matches[matchIndex])
+ p = fmt.Sprintf("[%s=%s]", name, regexp.QuoteMeta(matches[matchIndex]))
}
node.AppendToFieldPath(p)
}
