Documentation ¶
Index ¶
- func Expand(leftMargin int, forceList bool, name string, vals ...string) (string, error)
- func MergeMaps(mBase map[string]interface{}, mOverlay map[string]interface{}) error
- func ReplacementMerge(yamls ...string) (string, error)
- func StrategicMerge(strategy PatchStrategy, yamls ...string) (string, error)
- func StrategicMergeFiles(strategy PatchStrategy, yamlFiles ...string) (string, error)
- type PatchStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expand ¶
Expand a dot notated name to a YAML string. The value can be a string or string list. The simplest YAML is: a: b
Nested values are expanded as follows:
a.b.c : v1 expands to a: b: c: v1
If there is more than one value then
a.b : {v1,v2} expands to a: b: - v1 - v2
The last segment of the name might be a quoted string, for example:
controller.service.annotations."service\.beta\.kubernetes\.io/oci-load-balancer-shape" : flexible
which translates to
controller: service: annotations: service.beta.kubernetes.io/oci-load-balancer-shape: flexible
If forcelist is true then always use the list format.
func ReplacementMerge ¶
ReplacementMerge merges the YAML files returns a YAML string. The first YAML is overlayed by each subsequent YAML, lists are replaced
func StrategicMerge ¶
func StrategicMerge(strategy PatchStrategy, yamls ...string) (string, error)
StrategicMerge merges the YAML files returns a YAML string. The first YAML is overlayed by each subsequent YAML The strategy is a JSON annotated structure that represents the YAML structure
func StrategicMergeFiles ¶
func StrategicMergeFiles(strategy PatchStrategy, yamlFiles ...string) (string, error)
StrategicMergeFiles merges the YAML files returns a YAML string. The first file is overlayed by each subsequent file The strategy is a JSON annotated structure that represents the YAML structure
Types ¶
type PatchStrategy ¶
type PatchStrategy interface{}