helm

package
v0.0.0-...-210f5be Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sObject

type K8sObject interface {
	// GetName returns k8sobj name
	GetName() string

	// GetNamespace returns k8sobj namespace
	GetNamespace() string

	// GetLabels returns k8sobj labels
	GetLabels() map[string]string

	// UnstructuredObject returns the raw object, primarily for testing
	UnstructuredObject() *unstructured.Unstructured

	// GroupVersionKind returns the GroupVersionKind for the k8sobj
	GroupVersionKind() schema.GroupVersionKind

	// GroupKind returns the GroupKind for the k8sobj
	GroupKind() schema.GroupKind

	// Hash returns a unique hash for the k8sobj
	Hash() string

	// HashNameKind returns a hash for the k8sobj based on the name and kind only.
	HashNameKind() string

	// JSON returns a JSON representation of the k8sobj, using an internal cache.
	JSON() ([]byte, error)

	// YAML returns a yaml representation of the k8sobj, using an internal cache.
	YAML() ([]byte, error)

	// YAML2String returns a YAML representation of the k8sobj, or an error string if the k8sobj cannot be rendered to YAML.
	YAML2String() string

	// AddLabels add labels to k8sobj
	AddLabels(labels map[string]string)
}

K8sObject is an in-memory representation of a k8s object, used for moving between different representations (Unstructured, JSON, YAML) with cached rendering.

func NewK8sObject

func NewK8sObject(u *unstructured.Unstructured, json, yaml []byte) K8sObject

NewK8sObject creates a new k8sobj and returns a ptr to it.

func ParseJSON2K8sObject

func ParseJSON2K8sObject(json []byte) (K8sObject, error)

ParseJSON2K8sObject parses JSON to an k8sobj.

func ParseYAML2K8sObject

func ParseYAML2K8sObject(yaml []byte) (K8sObject, error)

ParseYAML2K8sObject parsed YAML to an k8sobj.

func RenderTemplate

func RenderTemplate(chartPkg []byte, rlsName, ns string, overrideValue string) ([]K8sObject, error)

RenderTemplate render chart template to k8s object slice

Jump to

Keyboard shortcuts

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