Skip to content

A Kustomize config function wrapping ReplacementTransformer plugin functionality

Notifications You must be signed in to change notification settings

mattmceuen/replacement-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replacement

This is an adaption of the Kustomize ReplacementTransformer plugin to the config function interface. It is based on the kubeval validation function.

Function implementation

The function is implemented as an image, and built using make image.

The function is implemented as a go program, which a configuration of replacement sources and targets, and applies them to the other YAML documents that are processed. The config file ReplacementTransformer syntax, but is annotated with a config.kubernetes.io/function container image.

Function configuration

A number of settings can be modified for kubeval in the function spec. See the API struct definition in main.go for documentation.

Function invocation

The function is invoked by authoring a local Resource with a metadata annotation of config.kubernetes.io/function:

kustomize config run local-resource/

Please note that this modifies the local-resource documents in line; this can be avoided by piping the output of the command when using the --dry-run flag.

Running the Example

Run the validator with:

kustomize config run local-resource/ --dry-run

This will return the input documents, with a single replacement applied against the Service's spec.environmentLabel.

About

A Kustomize config function wrapping ReplacementTransformer plugin functionality

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published