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 ¶
- func NewKunstructuredFactoryImpl() ifc.KunstructuredFactory
- func NewKunstructuredFromObject(obj runtime.Object) (ifc.Kunstructured, error)
- func NewKustHash() *kustHash
- type KunstructuredFactoryImpl
- func (kf *KunstructuredFactoryImpl) FromMap(m map[string]interface{}) ifc.Kunstructured
- func (kf *KunstructuredFactoryImpl) Hasher() ifc.KunstructuredHasher
- func (kf *KunstructuredFactoryImpl) MakeConfigMap(ldr ifc.Loader, options *types.GeneratorOptions, args *types.ConfigMapArgs) (ifc.Kunstructured, error)
- func (kf *KunstructuredFactoryImpl) MakeSecret(ldr ifc.Loader, options *types.GeneratorOptions, args *types.SecretArgs) (ifc.Kunstructured, error)
- func (kf *KunstructuredFactoryImpl) SliceFromBytes(in []byte) ([]ifc.Kunstructured, error)
- type PathSection
- type UnstructAdapter
- func (fs *UnstructAdapter) Copy() ifc.Kunstructured
- func (fs *UnstructAdapter) GetBool(path string) (bool, error)
- func (fs *UnstructAdapter) GetFieldValue(path string) (interface{}, error)
- func (fs *UnstructAdapter) GetFloat64(path string) (float64, error)
- func (fs *UnstructAdapter) GetGvk() gvk.Gvk
- func (fs *UnstructAdapter) GetInt64(path string) (int64, error)
- func (fs *UnstructAdapter) GetMap(path string) (map[string]interface{}, error)
- func (fs *UnstructAdapter) GetSlice(path string) ([]interface{}, error)
- func (fs *UnstructAdapter) GetString(path string) (string, error)
- func (fs *UnstructAdapter) GetStringMap(path string) (map[string]string, error)
- func (fs *UnstructAdapter) GetStringSlice(path string) ([]string, error)
- func (fs *UnstructAdapter) Map() map[string]interface{}
- func (fs *UnstructAdapter) MatchesAnnotationSelector(selector string) (bool, error)
- func (fs *UnstructAdapter) MatchesLabelSelector(selector string) (bool, error)
- func (fs *UnstructAdapter) Patch(patch ifc.Kunstructured) error
- func (fs *UnstructAdapter) SetGvk(g gvk.Gvk)
- func (fs *UnstructAdapter) SetMap(m map[string]interface{})
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) Hasher ¶
func (kf *KunstructuredFactoryImpl) Hasher() ifc.KunstructuredHasher
Hasher returns a kunstructured hasher input: kunstructured; output: string hash.
func (*KunstructuredFactoryImpl) MakeConfigMap ¶
func (kf *KunstructuredFactoryImpl) MakeConfigMap( ldr ifc.Loader, options *types.GeneratorOptions, args *types.ConfigMapArgs) (ifc.Kunstructured, error)
MakeConfigMap returns an instance of Kunstructured for ConfigMap
func (*KunstructuredFactoryImpl) MakeSecret ¶
func (kf *KunstructuredFactoryImpl) MakeSecret( ldr ifc.Loader, options *types.GeneratorOptions, args *types.SecretArgs) (ifc.Kunstructured, error)
MakeSecret returns an instance of Kunstructured for Secret
func (*KunstructuredFactoryImpl) SliceFromBytes ¶
func (kf *KunstructuredFactoryImpl) SliceFromBytes( in []byte) ([]ifc.Kunstructured, error)
SliceFromBytes returns a slice of Kunstructured.
type PathSection ¶
type PathSection struct {
// contains filtered or unexported fields
}
A PathSection contains a list of nested fields, which may end with an indexable value. For instance, foo.bar resolves to a PathSection with 2 fields and no index, while foo[0].bar resolves to two path sections, the first containing the field foo and the index 0, and the second containing the field bar, with no index. The latter PathSection references the bar field of the first item in the foo list
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) GetBool ¶
func (fs *UnstructAdapter) GetBool(path string) (bool, error)
GetBool returns value at the given fieldpath.
func (*UnstructAdapter) GetFieldValue ¶
func (fs *UnstructAdapter) GetFieldValue(path string) (interface{}, error)
GetFieldValue returns the value at the given fieldpath.
func (*UnstructAdapter) GetFloat64 ¶
func (fs *UnstructAdapter) GetFloat64(path string) (float64, error)
GetFloat64 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) GetInt64 ¶
func (fs *UnstructAdapter) GetInt64(path string) (int64, error)
GetInt64 returns value at the given fieldpath.
func (*UnstructAdapter) GetMap ¶
func (fs *UnstructAdapter) GetMap(path string) (map[string]interface{}, error)
GetMap returns value at the given fieldpath.
func (*UnstructAdapter) GetSlice ¶
func (fs *UnstructAdapter) GetSlice(path string) ([]interface{}, error)
GetSlice returns value at the given fieldpath.
func (*UnstructAdapter) GetString ¶
func (fs *UnstructAdapter) GetString(path string) (string, error)
GetString returns value at the given fieldpath.
func (*UnstructAdapter) GetStringMap ¶
func (fs *UnstructAdapter) GetStringMap(path string) (map[string]string, error)
GetStringMap returns value at the given fieldpath.
func (*UnstructAdapter) GetStringSlice ¶
func (fs *UnstructAdapter) GetStringSlice(path string) ([]string, error)
GetStringSlice returns value at the given fieldpath.
func (*UnstructAdapter) Map ¶
func (fs *UnstructAdapter) Map() map[string]interface{}
Map returns the unstructured content map.
func (*UnstructAdapter) MatchesAnnotationSelector ¶
func (fs *UnstructAdapter) MatchesAnnotationSelector(selector string) (bool, error)
func (*UnstructAdapter) MatchesLabelSelector ¶
func (fs *UnstructAdapter) MatchesLabelSelector(selector string) (bool, error)
func (*UnstructAdapter) Patch ¶ added in v3.0.2
func (fs *UnstructAdapter) Patch(patch ifc.Kunstructured) error
func (*UnstructAdapter) SetGvk ¶ added in v3.0.3
func (fs *UnstructAdapter) SetGvk(g gvk.Gvk)
SetGvk set the Gvk of the object to the input Gvk
func (*UnstructAdapter) SetMap ¶
func (fs *UnstructAdapter) SetMap(m map[string]interface{})
SetMap overrides the unstructured content map.