Skip to content

Commit 17449fa

Browse files
committed
Add comment on escaping . in fields using \
Signed-off-by: Tamal Saha <[email protected]>
1 parent e99a8fb commit 17449fa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/graph/lib.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ func Namespaces(kc client.Client, ref *unstructured.Unstructured, ns *rsapi.Name
755755
if ns.Path == MetadataNamespace {
756756
return []string{ref.GetNamespace()}, nil
757757
} else if ns.Path != "" {
758-
v, ok, err := unstructured.NestedString(ref.UnstructuredContent(), strings.Split(ns.Path, ".")...)
758+
v, ok, err := unstructured.NestedString(ref.UnstructuredContent(), fields(ns.Path)...)
759759
if ok {
760760
return []string{v}, nil
761761
}

pkg/graph/types.go

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ type ResourceRef struct {
8080
}
8181

8282
func fields(path string) []string {
83+
// TODO(tamal): support escape of . using \
8384
return strings.Split(strings.Trim(path, "."), ".")
8485
}
8586

0 commit comments

Comments
 (0)