Documentation ¶
Index ¶
- func ApplyResources(client client.Client, filename string) error
- func CreateOrPatchResources(c client.Client, file string) error
- func CreateResources(c client.Client, file string) error
- func DeleteResources(client client.Client, filename string) error
- func MustCreateOrPatchResources(t *testing.T, c client.Client, file string)
- func MustCreateResources(t *testing.T, c client.Client, file string)
- func MustDeleteResources(t *testing.T, c client.Client, filename string)
- func MustGetResource(t *testing.T, c client.Client, key client.ObjectKey, obj runtime.Object)
- func MustPatchResources(t *testing.T, c client.Client, file string)
- func ObjectKey(obj runtime.Object) client.ObjectKey
- func PatchResources(c client.Client, file string) error
- type K8sObject
- type K8sObjects
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustGetResource ¶
Types ¶
type K8sObject ¶
type K8sObject struct { Group string Kind string Name string Namespace string // contains filtered or unexported fields }
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 K8sObject and returns a ptr to it.
func ParseYAMLToK8sObject ¶
ParseYAMLToK8sObject parses YAML to an Object.
func (*K8sObject) GroupVersionKind ¶
func (o *K8sObject) GroupVersionKind() schema.GroupVersionKind
GroupVersionKind returns the GroupVersionKind for the K8sObject
func (*K8sObject) UnstructuredObject ¶
func (o *K8sObject) UnstructuredObject() *unstructured.Unstructured
UnstructuredObject exposes the raw object, primarily for testing
type K8sObjects ¶
type K8sObjects []*K8sObject
K8sObjects holds a collection of k8s objects, so that we can filter / sequence them
func ParseK8sObjectsFromYAMLManifest ¶
func ParseK8sObjectsFromYAMLManifest(manifest string) (K8sObjects, error)
ParseK8sObjectsFromYAMLManifest returns a K8sObjects representation of manifest.
func ParseObjects ¶
func ParseObjects(filename string) (K8sObjects, error)
func (K8sObjects) Sort ¶
func (os K8sObjects) Sort(score func(o *K8sObject) int)
Sort will order the items in K8sObjects in order of score, group, kind, name. The intent is to have a deterministic ordering in which K8sObjects are applied.