resources

package
v0.10.8 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyResources

func ApplyResources(client client.Client, filename string) error

func CreateOrPatchResources

func CreateOrPatchResources(c client.Client, file string) error

func CreateResources

func CreateResources(c client.Client, file string) error

func DeleteResources

func DeleteResources(client client.Client, filename string) error

func MustCreateOrPatchResources

func MustCreateOrPatchResources(t *testing.T, c client.Client, file string)

func MustCreateResources

func MustCreateResources(t *testing.T, c client.Client, file string)

func MustDeleteResources

func MustDeleteResources(t *testing.T, c client.Client, filename string)

func MustGetResource

func MustGetResource(t *testing.T, c client.Client, key client.ObjectKey, obj runtime.Object)

func MustPatchResources

func MustPatchResources(t *testing.T, c client.Client, file string)

func ObjectKey

func ObjectKey(obj runtime.Object) client.ObjectKey

func PatchResources

func PatchResources(c client.Client, file string) error

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

func ParseYAMLToK8sObject(yaml []byte) (*K8sObject, error)

ParseYAMLToK8sObject parses YAML to an Object.

func (*K8sObject) GroupKind

func (o *K8sObject) GroupKind() schema.GroupKind

GroupKind returns the GroupKind for the K8sObject

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.

Jump to

Keyboard shortcuts

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