const YAMLFileDelimiter = "\n---\n"
var ( // ErrUnstructuredFieldNotFound error returned when field not found in unstructured obj. ErrUnstructuredFieldNotFound = errors.New("field not found") )
func AddToUnstructuredListBytes(resources []byte, obj client.Object) ([]byte, error)
AddToUnstructuredListBytes takes in an UnstructuredList represented as []bytes and appends the provided client.Object to it. The result is seralized back into []byte and returned.
func FromJSON(jsonData []byte) ([]*unstructured.Unstructured, error)
FromJSON converts a json multi doc bytes to unstructured object list
func FromRuntime(obj runtime.Object) (*unstructured.Unstructured, error)
func FromUnstructured(u *unstructured.Unstructured, obj interface{}) (err error)
FromUnstructured converts from Unstructured to a concrete K8s type
func New(gv schema.GroupVersion, kind, namespace, name string) *unstructured.Unstructured
New creates an empty unstructured object with the provided type meta
func StringsToUnstructuredList(objs []string) (*unstructured.UnstructuredList, error)
StringsToUnstructuredList converts an array of strings into an UnstructuredList
func ToClientObjArray(objs ...*unstructured.Unstructured) []client.Object
ToClientObjArray converts one ore more unstructured objects into an array of client.Object by casting.
func ToJSON(uobjs []*unstructured.Unstructured) ([]byte, error)
ToJSON converts unstructured objects to multi doc json bytes
func ToUnstructured(obj client.Object) (*unstructured.Unstructured, error)
ToUnstructured converts a generic K8s object into Unstructured. Typically useful for working with libraries that accept []*unstructured.Unstructured
func ToUnstructuredArray(objs ...client.Object) ([]*unstructured.Unstructured, error)
ToUnstructuredArray converts one or more K8s objects into an array of Unstructured objects. Useful for working with libraries that accept []*unstructured.Unstructured
func ToUnstructuredList(obj client.Object) (*unstructured.UnstructuredList, error)
ToUnstructuredList converts a K8s object to Unstructured and then adds it to an UnstructuredList before returning it
func UnmarshalField(u *unstructured.Unstructured, v interface{}, fields ...string) error
UnmarshalField is a wrapper around JSON and Unstructured objects to decode and copy a specific field value into an object.
func UnstructuredListToStrings(unl *unstructured.UnstructuredList) ([]string, error)
UnstructuredListToStrings converts an UnstructuredList into an array of strings where each element is an item from the UnstructuredList
Aliases for upstream unstructured package types.
type Unstructured = unstructured.Unstructured