kubernetes

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndPrintDiffForManifests

func CreateAndPrintDiffForManifests(old Manifest, new Manifest, formatAsMarkdownCodeBlock bool, output io.Writer)

Creates and prints the diff for two manifests.

func FilterUnchangedManifests

func FilterUnchangedManifests(oldManifests ManifestMap, newManifests ManifestMap) (ManifestMap, ManifestMap)

Filters all common manifests with identical content from the given manifest maps. Returns two new maps which contain only the changed (new, altered or removed) manifests.

func GetUniqueManifestHashes

func GetUniqueManifestHashes(old ManifestMap, new ManifestMap) []string

Returns a list of MD5 hashes for all manifests in the given input maps. If a manifest with identical MD5 hash is present in both maps, the hash is returned only once.

Types

type Manifest

type Manifest struct {
	ApiVersion string
	Kind       string
	Name       string
	Namespace  string
	Content    string
}

A manifest describes a Kubernetes object with the most important parameters and its content.

func (Manifest) CalculateHash

func (m Manifest) CalculateHash() string

Calculates the MD5 hash for a manifest header (apiVersion, kind, name and namespace). Can be used to compare manifests.

type ManifestMap

type ManifestMap map[string]Manifest

This type contains the manifest hash as key and the manifest itself as value.

func SplitKustomizationIntoManifests

func SplitKustomizationIntoManifests(kustomization string) (ManifestMap, error)

Splits the given Kustomization into individual manifests per object.

type YamlObject

type YamlObject map[string]interface{}

This type is a convenience layer on top of a generic map and represents a YAML object.

Jump to

Keyboard shortcuts

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