Documentation

Overview

Package kunstruct provides unstructured from api machinery and factory for creating unstructured

Package kunstruct provides unstructured from api machinery and factory for creating unstructured

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKunstructuredFactoryImpl

func NewKunstructuredFactoryImpl() ifc.KunstructuredFactory

NewKunstructuredFactoryImpl returns a factory.

func NewKunstructuredFromObject

func NewKunstructuredFromObject(obj runtime.Object) (ifc.Kunstructured, error)

NewKunstructuredFromObject returns a new instance of Kunstructured.

Types

type KunstructuredFactoryImpl

type KunstructuredFactoryImpl struct {
	// contains filtered or unexported fields
}

KunstructuredFactoryImpl hides construction using apimachinery types.

func (*KunstructuredFactoryImpl) FromMap

func (kf *KunstructuredFactoryImpl) FromMap(
	m map[string]interface{}) ifc.Kunstructured

FromMap returns an instance of Kunstructured.

func (*KunstructuredFactoryImpl) MakeConfigMap

MakeConfigMap returns an instance of Kunstructured for ConfigMap

func (*KunstructuredFactoryImpl) MakeSecret

MakeSecret returns an instance of Kunstructured for Secret

func (*KunstructuredFactoryImpl) Set

func (kf *KunstructuredFactoryImpl) Set(ldr ifc.Loader)

Set sets loader

func (*KunstructuredFactoryImpl) SliceFromBytes

func (kf *KunstructuredFactoryImpl) SliceFromBytes(
	in []byte) ([]ifc.Kunstructured, error)

SliceFromBytes returns a slice of Kunstructured.

type UnstructAdapter

type UnstructAdapter struct {
	unstructured.Unstructured
}

UnstructAdapter wraps unstructured.Unstructured from https://github.com/kubernetes/apimachinery/blob/master/

pkg/apis/meta/v1/unstructured/unstructured.go

to isolate dependence on apimachinery.

func (*UnstructAdapter) Copy

func (fs *UnstructAdapter) Copy() ifc.Kunstructured

Copy provides a copy behind an interface.

func (*UnstructAdapter) GetFieldValue

func (fs *UnstructAdapter) GetFieldValue(path string) (string, error)

GetFieldValue returns value at the given fieldpath.

func (*UnstructAdapter) GetGvk

func (fs *UnstructAdapter) GetGvk() gvk.Gvk

GetGvk returns the Gvk name of the object.

func (*UnstructAdapter) Map

func (fs *UnstructAdapter) Map() map[string]interface{}

Map returns the unstructured content map.

func (*UnstructAdapter) SetMap

func (fs *UnstructAdapter) SetMap(m map[string]interface{})

SetMap overrides the unstructured content map.