Documentation ¶
Overview ¶
Package yaml handles the unmarshaling of YAML objects to strusts
Index ¶
- func CleanAnnotationsForExport(annotations map[string]string) map[string]string
- func CleanObjectForExport(obj runtime.Object) (runtime.Object, error)
- func Export(objects ...runtime.Object) ([]byte, error)
- func ToBytes(objects []runtime.Object) ([]byte, error)
- func ToObjects(in io.Reader) ([]runtime.Object, error)
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalWithJSONDecoder[T any](yamlReader io.Reader) ([]T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Export ¶
Export will attempt to clean up the objects a bit before rendering to yaml so that they can easily be imported into another cluster
func ToObjects ¶
ToObjects takes a reader of yaml bytes and returns a list of unstructured.Unstructured runtime.Objects that are read. If one of the objects read is an unstructured.UnstructuredList then the list is flattened to individual objects.
func Unmarshal ¶
Unmarshal decodes YAML bytes into document (as defined by the YAML spec) then converting it to JSON via "k8s.io/apimachinery/pkg/util/yaml".YAMLToJSON and then decoding the json in the the v interface{}
func UnmarshalWithJSONDecoder ¶
UnmarshalWithJSONDecoder expects a reader of raw YAML. It converts the document or documents to JSON, then decodes the JSON bytes into a slice of values of type T. Type T must be a pointer, or the function will panic.
Types ¶
This section is empty.