util

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package util provides utilities for testing.

Index

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

func ObjectKinds(scheme *runtime.Scheme, object runtime.Object) (schema.GroupVersionKind, error)

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

func SetGVKIfDoesNotExist(scheme *runtime.Scheme, object runtime.Object) (bool, error)

SetGVKIfDoesNotExist sets group,version,kind if they do not exist in object. If set, returns true.

func SplitManifests added in v0.0.2

func SplitManifests(data []byte) ([][]byte, error)

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

func SplitYAMLDocument(data []byte) ([][]byte, error)

SplitYAMLDocument is a splitting YAML document into individual documents.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL