Alterant comes with a set of helpers that make it easier to read, parse and modify configuration files, especially Kubernetes files. Here is a list of Alterant helpers. You can extend Alterant and add new ones yourself.
YamlReader loads a YAML file into an JSON string which can be used in the modifier.
var data = JSON.parse(YamlReader("foo.yaml"));
YamlReader only looks in the context folder (where the input file is located).
JsonReader loads a JSON file into an JSON string which can be used in the modifier.
var data = JSON.parse(JsonReader("foo.json"));
JsonReader only looks in the context folder (where the input file is located).
DockerImage contains helpers for processing Docker images.
var image = new DockerImage("ubuntu");
fqin: Fully Qualified Image Name (with schema, full URL, name and tag)
registry: Registry name
registry_url: Registry URL
name: Image name
tag: Image tag
DockerImage will fill in the missing data based on Docker image conventions (like
latest when no tag is present,
index.docker.io as the registry if none is present and more)
Returns a string that has all the constituents of the image which can be used in a modifier.
Containers loads a container from a Kubernetes container definition and provides helpers to extract information about those.
containers: List of all containers
Finds a specific container by its name.