support mapping values with '.' in replacements fieldpaths

This commit is contained in:
Natasha Sarkar
2021-06-10 11:29:04 -07:00
parent cebda58437
commit 218da9858f
3 changed files with 27 additions and 6 deletions

View File

@@ -81,6 +81,10 @@ func TestSmarterPathSplitter(t *testing.T) {
input: "spec.data.[name=f.i.[r.s.t..key",
expected: []string{"spec", "data", "[name=f.i.[r.s.t..key"},
},
"mapping value with .": {
input: "metadata.annotations.[a.b.c/d.e.f-g.]",
expected: []string{"metadata", "annotations", "a.b.c/d.e.f-g."},
},
}
for tn, tc := range testCases {
t.Run(tn, func(t *testing.T) {