Alterant Helpers

Helpers

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

YamlReader loads a YAML file into an object which can be used in the modifier.

var data = YamlReader("foo.yaml");

YamlReader only looks in the context folder (where the input file is located).

JsonReader

JsonReader loads a JSON file into an object which can be used in the modifier.

var data = JsonReader("foo.json");

JsonReader only looks in the context folder (where the input file is located).

DockerImage

DockerImage contains helpers for processing Docker images.

var image = new DockerImage("ubuntu");

Attributes

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)

Methods

address()

Returns a string that has all the constituents of the image which can be used in a modifier.

Containers

Containers loads a container from a Kubernetes container definition and provides helpers to extract information about those.

Attributes

Methods

by_name(string)

Finds a specific container by its name.