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 ReadFiles(pattern 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 or JSON stream and reads all unstructured.Unstructured objects of it.
The document has to be well-formed. For multi-doc YAMLs, '---' is used as 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 ReadFiles ¶ added in v0.1.4
func ReadFiles(pattern string) ([]unstructured.Unstructured, error)
ReadFiles reads unstructured objects from a folder with the given name (including sub folders) and file name matched with the pattern.
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.