Documentation ¶
Index ¶
- func HashedConfig(uList []unstructured.Unstructured) (map[string]string, error)
- func HashedJobs(jobs []v1.Job, config map[string]string) (map[string]string, error)
- func JobSlice(uList []unstructured.Unstructured) ([]v1.Job, error)
- func ResourcesFromReader(rdr io.Reader) ([]unstructured.Unstructured, error)
- func SuffixJobs(data io.Reader) ([]byte, error)
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 ¶
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 ¶
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.