duck

package
v3.0.85 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromUnstructured

func FromUnstructured(obj json.Marshaler, target interface{}) error

FromUnstructured takes unstructured object from (say from client-go/dynamic) and converts it into our duck types.

func ToUnstructured

func ToUnstructured(desired OneOfOurs) (*unstructured.Unstructured, error)

ToUnstructured takes an instance of a OneOfOurs compatible type and converts it to unstructured.Unstructured. We take OneOfOurs in place or runtime.Object because sometimes we get resources that do not have their TypeMeta populated but that is required for unstructured.Unstructured to deserialize things, so we leverage our content-agnostic GroupVersionKind() method to populate this as-needed (in a copy, so that we don't modify the informer's copy, if that is what we are passed).

Types

type OneOfOurs

type OneOfOurs interface {
	kmeta.Accessor
	kmeta.OwnerRefable
}

OneOfOurs is the union of our Accessor interface and the OwnerRefable interface that is implemented by our resources that implement the kmeta.Accessor.

Jump to

Keyboard shortcuts

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