patches

package
v0.21.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(obj1 *yaml.Node, patch *config.Patch) error

func AddChildAtIndex

func AddChildAtIndex(parent *yaml.Node, child *yaml.Node, value *yaml.Node) []*yaml.Node

func AddNode

func AddNode(obj1 *yaml.Node, match *yaml.Node, value *yaml.Node)

func ApplyPatches

func ApplyPatches(destObj, sourceObj client.Object, patchesConf []*vclusterconfig.Patch, reversePatchesConf []*vclusterconfig.Patch, nameResolver NameResolver) error

func ChildIndex

func ChildIndex(children []*yaml.Node, child *yaml.Node) int

func ContainsChild

func ContainsChild(child *yaml.Node) func(*yaml.Node) bool

func CopyFromObject

func CopyFromObject(obj1, obj2 *yaml.Node, patch *config.Patch) error

func Find

func Find(doc *yaml.Node, predicate func(*yaml.Node) bool) *yaml.Node

func FindMatches

func FindMatches(doc *yaml.Node, path string) ([]*yaml.Node, error)

func GetNamespace

func GetNamespace(obj *yaml.Node, patch *config.Patch) (string, error)

func NewJSONNode

func NewJSONNode(raw interface{}) (*yaml.Node, error)

func NewNode

func NewNode(raw interface{}) (*yaml.Node, error)

func NewNodeFromString

func NewNodeFromString(in string) (*yaml.Node, error)

func ProcessRewrite

func ProcessRewrite(obj *yaml.Node, patch *config.Patch, resolver NameResolver) error

func Remove

func Remove(obj1 *yaml.Node, patch *config.Patch) error

func Replace

func Replace(obj1 *yaml.Node, patch *config.Patch) error

func ReplaceNode

func ReplaceNode(doc *yaml.Node, match *yaml.Node, value *yaml.Node)

func RewriteLabelExpressionsSelector

func RewriteLabelExpressionsSelector(obj1 *yaml.Node, patch *config.Patch, resolver NameResolver) error

func RewriteLabelKey

func RewriteLabelKey(obj1 *yaml.Node, patch *config.Patch, resolver NameResolver) error

func RewriteLabelSelector

func RewriteLabelSelector(obj1 *yaml.Node, patch *config.Patch, resolver NameResolver) error

func RewriteName

func RewriteName(obj1 *yaml.Node, patch *config.Patch, resolver NameResolver) error

func ValidateAllConditions

func ValidateAllConditions(obj *yaml.Node, match *yaml.Node, conditions []*config.PatchCondition) (bool, error)

func ValidateAndTranslateName

func ValidateAndTranslateName(obj *yaml.Node, match *yaml.Node, patch *config.Patch, resolver NameResolver, namespace string) error

func ValidateAndTranslateNamespace

func ValidateAndTranslateNamespace(obj *yaml.Node, match *yaml.Node, patch *config.Patch, resolver NameResolver) error

func ValidateCondition

func ValidateCondition(obj *yaml.Node, match *yaml.Node, condition *config.PatchCondition) (bool, error)

Types

type NameResolver

type NameResolver interface {
	TranslateName(name string, regex *regexp.Regexp, path string) (string, error)
	TranslateLabelKey(key string) (string, error)
	TranslateLabelExpressionsSelector(selector *metav1.LabelSelector) (*metav1.LabelSelector, error)
	TranslateLabelSelector(selector map[string]string) (map[string]string, error)
	TranslateNameWithNamespace(name string, namespace string, regex *regexp.Regexp, path string) (string, error)
	TranslateNamespaceRef(namespace string) (string, error)
}

type OpPath

type OpPath string

OpPath is an yaml-jsonpath 'selector'. For more info see: https://github.com/vmware-labs/yaml-jsonpath

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL