Documentation ¶
Overview ¶
Package transformers has implementations of resmap.ResMap transformers.
Index ¶
- type PathConfig
- type Transformer
- func NewDefaultingAnnotationsMapTransformer(m map[string]string) (Transformer, error)
- func NewDefaultingLabelsMapTransformer(m map[string]string) (Transformer, error)
- func NewDefaultingNamePrefixTransformer(nameprefix string) (Transformer, error)
- func NewDefaultingNameReferenceTransformer() (Transformer, error)
- func NewMapTransformer(pc []PathConfig, m map[string]string) (Transformer, error)
- func NewMultiTransformer(t []Transformer) Transformer
- func NewNameHashTransformer() Transformer
- func NewNamePrefixTransformer(pc []PathConfig, np string) (Transformer, error)
- func NewNameReferenceTransformer(pc []referencePathConfig) (Transformer, error)
- func NewNamespaceTransformer(ns string) Transformer
- func NewNoOpTransformer() Transformer
- func NewPatchTransformer(slice []*resource.Resource) (Transformer, error)
- func NewRefVarTransformer(vars map[string]string) (Transformer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathConfig ¶
type PathConfig struct { // If true, it will create the path if it is not found. CreateIfNotPresent bool // The gvk that this path tied to. // If unset, it applied to any gvk // If some fields are set, it applies to all matching gvk. GroupVersionKind *schema.GroupVersionKind // Path to the field that will be munged. Path []string }
PathConfig contains the configuration of a field, including the gvk it ties to, path to the field, etc.
type Transformer ¶
type Transformer interface { // Transform modifies data in the argument, e.g. adding labels to resources that can be labelled. Transform(m resmap.ResMap) error }
A Transformer modifies an instance of resmap.ResMap.
func NewDefaultingAnnotationsMapTransformer ¶
func NewDefaultingAnnotationsMapTransformer(m map[string]string) (Transformer, error)
NewDefaultingAnnotationsMapTransformer construct a mapTransformer with defaultAnnotationsPathConfigs.
func NewDefaultingLabelsMapTransformer ¶
func NewDefaultingLabelsMapTransformer(m map[string]string) (Transformer, error)
NewDefaultingLabelsMapTransformer construct a mapTransformer with defaultLabelsPathConfigs.
func NewDefaultingNamePrefixTransformer ¶
func NewDefaultingNamePrefixTransformer(nameprefix string) (Transformer, error)
NewDefaultingNamePrefixTransformer construct a namePrefixTransformer with defaultNamePrefixPathConfigs.
func NewDefaultingNameReferenceTransformer ¶
func NewDefaultingNameReferenceTransformer() (Transformer, error)
NewDefaultingNameReferenceTransformer constructs a nameReferenceTransformer with defaultNameReferencepathConfigs.
func NewMapTransformer ¶
func NewMapTransformer(pc []PathConfig, m map[string]string) (Transformer, error)
NewMapTransformer construct a mapTransformer.
func NewMultiTransformer ¶
func NewMultiTransformer(t []Transformer) Transformer
NewMultiTransformer constructs a multiTransformer.
func NewNameHashTransformer ¶
func NewNameHashTransformer() Transformer
NewNameHashTransformer construct a nameHashTransformer.
func NewNamePrefixTransformer ¶
func NewNamePrefixTransformer(pc []PathConfig, np string) (Transformer, error)
NewNamePrefixTransformer construct a namePrefixTransformer.
func NewNameReferenceTransformer ¶
func NewNameReferenceTransformer(pc []referencePathConfig) (Transformer, error)
NewNameReferenceTransformer construct a nameReferenceTransformer.
func NewNamespaceTransformer ¶ added in v1.0.2
func NewNamespaceTransformer(ns string) Transformer
NewNamespaceTransformer construct a namespaceTransformer.
func NewNoOpTransformer ¶
func NewNoOpTransformer() Transformer
NewNoOpTransformer constructs a noOpTransformer.
func NewPatchTransformer ¶ added in v1.0.2
func NewPatchTransformer(slice []*resource.Resource) (Transformer, error)
NewPatchTransformer constructs a patchTransformer.
func NewRefVarTransformer ¶ added in v1.0.2
func NewRefVarTransformer(vars map[string]string) (Transformer, error)
NewRefVarTransformer returns a Trasformer that replaces $(VAR) style variables with values.