unstructured

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnsafeObjectConvertor

func UnsafeObjectConvertor(scheme *Scheme) runtime.ObjectConvertor

Types

type Scheme

type Scheme struct{}

func NewScheme

func NewScheme() *Scheme

func (*Scheme) ConvertFieldLabel

func (s *Scheme) ConvertFieldLabel(gvk schema.GroupVersionKind, label, value string) (string, string, error)

func (*Scheme) ConvertToVersion

func (s *Scheme) ConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error)

ConvertToVersion converts in object to the given gvk in place and returns the same `in` object. The in object can be a single object or a UnstructuredList. CRD storage implementation creates an UnstructuredList with the request's GV, populates it from storage, then calls conversion to convert the individual items. This function assumes it never gets a v1.List.

func (*Scheme) Default

func (s *Scheme) Default(_ runtime.Object)

func (*Scheme) New

func (*Scheme) ObjectKinds

func (s *Scheme) ObjectKinds(obj runtime.Object) (gvks []schema.GroupVersionKind, unversionedType bool, err error)

ObjectKinds returns a slice of one element with the group,version,kind of the provided object, or an error if the object is not runtime.Unstructured or has no group,version,kind information. unversionedType will always be false because runtime.Unstructured object should always have group,version,kind information set.

reference from https://github.com/kubernetes/apiextensions-apiserver/blob/b0680ddb99b88a5978a43fe4f2508dce81be1ec9/pkg/crdserverscheme/unstructured.go#L46

func (*Scheme) Recognizes

func (s *Scheme) Recognizes(gvk schema.GroupVersionKind) bool

Recognizes does not delegate the Recognizes check, needs to be wrapped by the caller to check the specific gvk

func (*Scheme) UnsafeConvert

func (s *Scheme) UnsafeConvert(in, out, context interface{}) error

func (*Scheme) UnsafeConvertToVersion

func (s *Scheme) UnsafeConvertToVersion(in runtime.Object, target runtime.GroupVersioner) (runtime.Object, error)

Jump to

Keyboard shortcuts

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