...

Package order

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

Overview ▾

func SyncOrder

func SyncOrder(from, to *yaml.RNode) error

SyncOrder recursively sorts the map node keys in 'to' node to match the order of map node keys in 'from' node at same tree depth, additional keys are moved to the end Field order might be altered due to round-tripping in arbitrary functions. This functionality helps to retain the original order of fields to avoid unnecessary diffs.

func VisitElements

func VisitElements(from, to *yaml.RNode, fn func(fNode, tNode *yaml.RNode) error) error

VisitElements calls fn for each element in a SequenceNode. Returns an error for non-SequenceNodes

func VisitFields

func VisitFields(from, to *yaml.RNode, fn func(fNode, tNode *yaml.MapNode) error) error

VisitFields calls fn for each field in the RNode. Returns an error for non-MappingNodes.