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 ¶
ParseJSON2K8sObject parses JSON to an k8sobj.
func ParseYAML2K8sObject ¶
ParseYAML2K8sObject parsed YAML to an k8sobj.
Click to show internal directories.
Click to hide internal directories.