Documentation
¶
Overview ¶
Package kube provides utilities for working with Kubernetes objects, including parsing YAML documents and extracting metadata.
Index ¶
- Variables
- func ObjectEqual(a, b *Object) bool
- type Object
- func (o Object) GetAPIVersion() string
- func (o Object) GetGroup() string
- func (o Object) GetGroupKind() string
- func (o Object) GetKind() string
- func (o Object) GetMetadata() ResourceMetadata
- func (o Object) GetName() string
- func (o Object) GetNamespace() string
- func (o Object) GetNamespacedName() string
- type Resource
- type ResourceMetadata
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidYAML = errors.New("invalid yaml") ErrInvalidKubeResource = errors.New("invalid kubernetes resource") )
Functions ¶
func ObjectEqual ¶
ObjectEqual compares two Object instances for equality based on their apiVersion, kind, namespace, and name.
Types ¶
type Object ¶
func (Object) GetAPIVersion ¶
GetAPIVersion returns the apiVersion of the object. If apiVersion is not set, it returns an empty string.
func (Object) GetGroup ¶
GetGroup returns the group of the object, which is the first part of the apiVersion. If the group is not set, it assumes "core".
func (Object) GetGroupKind ¶
GetGroupKind returns the group and kind of the object in the format `group/kind`. If the group is not set, it returns just the kind.
func (Object) GetKind ¶
GetKind returns the kind of the object. If the kind is not set, it returns "<empty>".
func (Object) GetMetadata ¶ added in v0.25.0
func (o Object) GetMetadata() ResourceMetadata
func (Object) GetName ¶
GetName returns the name of the object. If the name is not set, it returns "<empty>".
func (Object) GetNamespace ¶
GetNamespace returns the namespace of the object. If the namespace is not set, it returns an empty string.