...

Package utils

import "sigs.k8s.io/kustomize/kyaml/utils"
Overview
Index

Overview ▾

func PathSplitter

func PathSplitter(path string, delimiter string) []string

PathSplitter splits a delimited string, permitting escaped delimiters.

func SmarterPathSplitter

func SmarterPathSplitter(path string, delimiter string) []string

SmarterPathSplitter splits a path, retaining bracketed elements. If the element is a list entry identifier (defined by the '='), it will retain the brackets. E.g. "[name=com.foo.someapp]" survives as one thing after splitting "spec.template.spec.containers.[name=com.foo.someapp].image" See kyaml/yaml/match.go for use of list entry identifiers. If the element is a mapping entry identifier, it will remove the brackets. E.g. "a.b.c" survives as one thing after splitting "metadata.annotations.[a.b.c] This function uses `PathSplitter`, so it also respects escaped delimiters.