Documentation ¶
Overview ¶
Package unstructuredutils provides utilities working with the unstructured.Unstructured type.
Index ¶
- func Read(r io.Reader) ([]unstructured.Unstructured, error)
- func ReadFile(filename string) ([]unstructured.Unstructured, error)
- func UnstructuredSliceToObjectSlice(unstructureds []unstructured.Unstructured) []client.Object
- func UnstructuredSliceToObjectSliceNoCopy(unstructureds []unstructured.Unstructured) []client.Object
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
func Read(r io.Reader) ([]unstructured.Unstructured, error)
Read treats io.Reader as an incoming YAML stream and reads all unstructured.Unstructured objects of it.
The YAML has to be well-formed multi-document YAML separated with the separator '---'. Empty sub-documents are filtered from the resulting list.
func ReadFile ¶
func ReadFile(filename string) ([]unstructured.Unstructured, error)
ReadFile reads unstructured objects from a file with the given name. For further reference, have a look at Read.
func UnstructuredSliceToObjectSlice ¶
func UnstructuredSliceToObjectSlice(unstructureds []unstructured.Unstructured) []client.Object
UnstructuredSliceToObjectSlice transforms the given list of unstructured.Unstructured to a list of client.Object, copying the unstructured.Unstructured and using the pointers of them for the resulting client.Object.
func UnstructuredSliceToObjectSliceNoCopy ¶
func UnstructuredSliceToObjectSliceNoCopy(unstructureds []unstructured.Unstructured) []client.Object
UnstructuredSliceToObjectSliceNoCopy transforms the given list of unstructured.Unstructured to a list of client.Object, performing no copy while doing so.
When creating the list, the resulting client.Object objects are obtained from having a pointer to the original slice item.
Types ¶
This section is empty.