Documentation
¶
Overview ¶
Package patch applies RFC 6902 JSON Patch operations to a YAML release tree.
The patch itself is applied by a standard JSON Patch library, so serialization to JSON is required — which drops YAML custom tags (e.g. !lock), comments and key order. Those are restored from the original tree afterwards via yml.CopyMetadata. It also exposes a few node-level setters used for built-in transforms that must run before the JSON round-trip.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply applies the ops to doc (a document node) and returns the resulting document. The patch is applied via a JSON Patch library; custom tags, comments and key order are then restored from doc, and styles are cleared so the result serializes as clean block YAML. When there are no ops, doc is returned unchanged.
func SetPath ¶
SetPath sets a mapping value at the given path (tokens), adding or replacing as needed. Every intermediate node must already exist and be a mapping. Used for built-in transforms.
func SetPathCreating ¶
SetPathCreating is like SetPath but creates any missing intermediate mapping nodes (merging into existing ones rather than clobbering). Used for built-ins that may target absent parents (e.g. metadata.labels).