Documentation ¶
Overview ¶
Package util provides utilities for testing.
Index ¶
- func MustRawManifestToObject(scheme *runtime.Scheme, data []byte) (runtime.Object, *schema.GroupVersionKind)
- func ObjectKinds(scheme *runtime.Scheme, object runtime.Object) (schema.GroupVersionKind, error)
- func RawManifestToObject(scheme *runtime.Scheme, data []byte) (runtime.Object, *schema.GroupVersionKind, error)
- func SetGVKIfDoesNotExist(scheme *runtime.Scheme, object runtime.Object) (bool, error)
- func SplitManifests(data []byte) ([][]byte, error)
- func SplitYAMLDocument(data []byte) ([][]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRawManifestToObject ¶
func MustRawManifestToObject(scheme *runtime.Scheme, data []byte) (runtime.Object, *schema.GroupVersionKind)
MustRawManifestToObject calls RawManifestToObject and panics if an error exists.
func ObjectKinds ¶
ObjectKinds returns group,version,kind of the object. It may be possible to get multiple group,version,kind in which case error will be returned.
func RawManifestToObject ¶
func RawManifestToObject(scheme *runtime.Scheme, data []byte) (runtime.Object, *schema.GroupVersionKind, error)
RawManifestToObject converts a raw manifest to a object. Attempts to convert to unstructured.Unstructured if no type is registered in scheme.
func SetGVKIfDoesNotExist ¶
SetGVKIfDoesNotExist sets group,version,kind if they do not exist in object. If set, returns true.
func SplitManifests ¶ added in v0.0.2
SplitManifests takes a single large manifest and splits it into individual manifests. Both JSON and YAML are supported, but the returned manifests will be converted to JSON.
func SplitYAMLDocument ¶ added in v0.0.2
SplitYAMLDocument is a splitting YAML document into individual documents.
Types ¶
This section is empty.