Documentation ¶
Index ¶
- func GetAPIVersion(node *yaml.RNode, path string) string
- func GetKind(node *yaml.RNode, path string) string
- func GetLabels(node *yaml.RNode, path string) (map[string]string, error)
- func GetName(node *yaml.RNode, path string) string
- func GetNamespace(node *yaml.RNode, path string) string
- func GetStringField(node *yaml.RNode, path string, fields ...string) string
- func IsClusterKind(kind string) bool
- func IsCustomResourceDefinition(kind string) bool
- func JSONPath(fields ...string) string
- func ModifyFiles(dir string, modifyFn func(node *yaml.RNode, path string) (bool, error), ...) error
- func SetStringValue(node *yaml.RNode, path string, value string, fields ...string) error
- func TrimSpaceAndQuotes(answer string) string
- type APIVersionKindsFilter
- type Filter
- type KindFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAPIVersion ¶
GetAPIVersion finds the API Version of the node at the given path
func GetNamespace ¶
GetNamespace returns the namespace from the metadata
func GetStringField ¶
/ GetStringField returns the given field from the node or returns a blank string if the field cannot be found
func IsClusterKind ¶
IsClusterKind returns true if the kind is a cluster kind
func IsCustomResourceDefinition ¶ added in v3.0.16
IsCustomResourceDefinition returns true if the kind is a customresourcedefinition
func ModifyFiles ¶
func ModifyFiles(dir string, modifyFn func(node *yaml.RNode, path string) (bool, error), filter Filter) error
ModifyFiles recursively walks the given directory and modifies any suitable file
func SetStringValue ¶
SetStringValue sets the string value at the given path
func TrimSpaceAndQuotes ¶
TrimSpaceAndQuotes trims any whitespace and quotes around a value
Types ¶
type APIVersionKindsFilter ¶
type APIVersionKindsFilter struct { Kinds []KindFilter KindsIgnore []KindFilter }
APIVersionKindsFilter a filter of kinds and/or API versions
type Filter ¶
type Filter struct { Kinds []string KindsIgnore []string Names []string Selector map[string]string InvertSelector bool }
Filter for filtering
func (*Filter) Parse ¶
func (f *Filter) Parse() APIVersionKindsFilter
Parse parses the filter strings
type KindFilter ¶
KindFilter a filter on a kind and an optional APIVersion
func ParseKindFilter ¶
func ParseKindFilter(text string) KindFilter
ParseKindFilter parses a kind filter