kujo

package
v0.0.0-...-96ae45c Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashedConfig

func HashedConfig(uList []unstructured.Unstructured) (map[string]string, error)

HashedConfig goes over a given set of unstructured objects and filters out the ConfigMap and Secret objects. It then hashes it's content and returns a map of hashes, where the key is in the `<namespace>/<name>` format.

func HashedJobs

func HashedJobs(jobs []v1.Job, config map[string]string) (map[string]string, error)

HashedJobs goes over a list of jobs and creates a unique hash for said job's configuration. The list is returned as a map where the key represents the original namespace and name for the job so it can be mapped back to the original list of resources.

func JobSlice

func JobSlice(uList []unstructured.Unstructured) ([]v1.Job, error)

JobSlice goes over a set of unstructured objects and returns a new slice with only jobs in them.

func ResourcesFromReader

func ResourcesFromReader(rdr io.Reader) ([]unstructured.Unstructured, error)

ResourcesFromReader takes a reader object and parses the data into a slice of unstructured resources. The reader should either contain JSON or YAML objects. The objects are filtered based on their type. Only ConfigMap, Job and Secret resources are returned.

func SuffixJobs

func SuffixJobs(data io.Reader) ([]byte, error)

SuffixJobs takes a list of Kubernetes resources and goes over all the jobs. It matches the job's configuration with ConfigMap and Secret objects and calculates a unique hash from all three configurations to determine a unique name for each job. Once done, it replaces all the job names from the input with the newly calculated job name and outputs the data byte slice filled with YAML.

Types

This section is empty.

Jump to

Keyboard shortcuts

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