yaml

package
v0.0.0-...-a7b7215 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: UPL-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(leftMargin int, forceList bool, name string, vals ...string) (string, error)

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 MergeMaps

func MergeMaps(mBase map[string]interface{}, mOverlay map[string]interface{}) error

mergeMaps 2 maps where mOverlay overrides mBase

func ReplacementMerge

func ReplacementMerge(yamls ...string) (string, error)

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{}

Jump to

Keyboard shortcuts

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