resources

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: Apache-2.0, MIT Imports: 33 Imported by: 65

Documentation

Index

Constants

View Source
const ATTR_EVENTSOURCE = "event-source"

Variables

This section is empty.

Functions

func AddOwner

func AddOwner(data ObjectData, clusterid string, obj Object) bool

func CreateOrModify

func CreateOrModify(obj Object, f func(*ModificationState) error) (bool, error)

func DeclareDefaultVersion

func DeclareDefaultVersion(gv schema.GroupVersion)

func DefaultScheme

func DefaultScheme() *runtime.Scheme

func DefaultVersion

func DefaultVersion(g string) string

func GetAnnotatedOwners

func GetAnnotatedOwners(data ObjectData) []string

func GetAnnotation

func GetAnnotation(o ObjectData, key string) (string, bool)

func GetLabel

func GetLabel(o ObjectData, key string) (string, bool)

func GetSecretPropertiesFrom

func GetSecretPropertiesFrom(secret *api.Secret) utils.Properties

func Modify

func Modify(obj Object, f func(*ModificationState) error) (bool, error)

func NewAbstractResource

func NewAbstractResource(self Internal) (AbstractResource, *ResourceHelper)

func NewGroupKind

func NewGroupKind(group, kind string) schema.GroupKind

func NewObjectName

func NewObjectName(names ...string) objectName

func NewWatchWrapper

func NewWatchWrapper(ctx context.Context, orig watch.Interface) watch.Interface

func ObjectArrayToString

func ObjectArrayToString(objs ...Object) string

func Register

func Register(builders ...runtime.SchemeBuilder)

func RemoveAnnotation

func RemoveAnnotation(o ObjectData, key string) bool

func RemoveLabel

func RemoveLabel(o ObjectData, key string) bool

func RemoveOwnerReference

func RemoveOwnerReference(o ObjectData, ref *metav1.OwnerReference) bool

func SetAnnotation

func SetAnnotation(o ObjectData, key, value string) bool

func SetLabel

func SetLabel(o ObjectData, key, value string) bool

func SetOwnerReference

func SetOwnerReference(o ObjectData, ref *metav1.OwnerReference) bool

Types

type AbstractObject

type AbstractObject struct {
	ObjectData
	// contains filtered or unexported fields
}

func NewAbstractObject

func NewAbstractObject(self I_Object, data ObjectData) AbstractObject

func (*AbstractObject) AddOwner

func (this *AbstractObject) AddOwner(obj Object) bool

func (*AbstractObject) AnnotatedEventf

func (this *AbstractObject) AnnotatedEventf(annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{})

func (*AbstractObject) ClusterKey

func (this *AbstractObject) ClusterKey() ClusterObjectKey

func (*AbstractObject) Create

func (this *AbstractObject) Create() error

func (*AbstractObject) CreateOrModify

func (this *AbstractObject) CreateOrModify(modifier Modifier) (bool, error)

func (*AbstractObject) CreateOrUpdate

func (this *AbstractObject) CreateOrUpdate() error

func (*AbstractObject) Data

func (this *AbstractObject) Data() ObjectData

func (*AbstractObject) Delete

func (this *AbstractObject) Delete() error

func (*AbstractObject) Description

func (this *AbstractObject) Description() string

func (*AbstractObject) Event

func (this *AbstractObject) Event(eventtype, reason, message string)

func (*AbstractObject) Eventf

func (this *AbstractObject) Eventf(eventtype, reason, messageFmt string, args ...interface{})

func (*AbstractObject) GetOwnerReference

func (this *AbstractObject) GetOwnerReference() *metav1.OwnerReference

func (*AbstractObject) GetOwners

func (this *AbstractObject) GetOwners(kinds ...schema.GroupKind) ClusterObjectKeySet

func (*AbstractObject) GroupKind

func (this *AbstractObject) GroupKind() schema.GroupKind

func (*AbstractObject) GroupVersionKind

func (this *AbstractObject) GroupVersionKind() schema.GroupVersionKind

func (*AbstractObject) IsCoLocatedTo

func (this *AbstractObject) IsCoLocatedTo(o Object) bool

func (*AbstractObject) IsDeleting

func (this *AbstractObject) IsDeleting() bool

func (*AbstractObject) Key

func (this *AbstractObject) Key() ObjectKey

func (*AbstractObject) Modify

func (this *AbstractObject) Modify(modifier Modifier) (bool, error)

func (*AbstractObject) ModifyStatus

func (this *AbstractObject) ModifyStatus(modifier Modifier) (bool, error)

func (*AbstractObject) ObjectName

func (this *AbstractObject) ObjectName() ObjectName

func (*AbstractObject) PastEventf

func (this *AbstractObject) PastEventf(timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{})

func (*AbstractObject) RemoveOwner

func (this *AbstractObject) RemoveOwner(obj Object) bool

func (*AbstractObject) Resources

func (this *AbstractObject) Resources() Resources

func (*AbstractObject) Update

func (this *AbstractObject) Update() error

func (*AbstractObject) UpdateFromCache

func (this *AbstractObject) UpdateFromCache() error

func (*AbstractObject) UpdateStatus

func (this *AbstractObject) UpdateStatus() error

type AbstractResource

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

func (*AbstractResource) Create

func (this *AbstractResource) Create(obj ObjectData) (Object, error)

func (*AbstractResource) CreateOrUpdate

func (this *AbstractResource) CreateOrUpdate(obj ObjectData) (Object, error)

func (*AbstractResource) Delete

func (this *AbstractResource) Delete(obj ObjectData) error

func (*AbstractResource) DeleteByName

func (this *AbstractResource) DeleteByName(obj ObjectDataName) error

func (*AbstractResource) GetInto

func (this *AbstractResource) GetInto(name ObjectName, obj ObjectData) (Object, error)

func (*AbstractResource) Get_

func (this *AbstractResource) Get_(obj interface{}) (Object, error)

func (*AbstractResource) GroupKind

func (this *AbstractResource) GroupKind() schema.GroupKind

func (*AbstractResource) GroupVersionKind

func (this *AbstractResource) GroupVersionKind() schema.GroupVersionKind

func (*AbstractResource) List

func (this *AbstractResource) List(opts metav1.ListOptions) (ret []Object, err error)

func (*AbstractResource) Modify

func (this *AbstractResource) Modify(obj ObjectData, modifier Modifier) (ObjectData, bool, error)

func (*AbstractResource) ModifyByName

func (this *AbstractResource) ModifyByName(obj ObjectDataName, modifier Modifier) (Object, bool, error)

func (*AbstractResource) ModifyStatus

func (this *AbstractResource) ModifyStatus(obj ObjectData, modifier Modifier) (ObjectData, bool, error)

func (*AbstractResource) ModifyStatusByName

func (this *AbstractResource) ModifyStatusByName(obj ObjectDataName, modifier Modifier) (Object, bool, error)

func (*AbstractResource) Name

func (this *AbstractResource) Name() string

func (*AbstractResource) Namespace

func (this *AbstractResource) Namespace(namespace string) Namespaced

func (*AbstractResource) Namespaced

func (this *AbstractResource) Namespaced() bool

func (*AbstractResource) New

func (this *AbstractResource) New(name ObjectName) Object

func (*AbstractResource) Update

func (this *AbstractResource) Update(obj ObjectData) (Object, error)

func (*AbstractResource) Wrap

func (this *AbstractResource) Wrap(obj ObjectData) (Object, error)

type Clients

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

func NewClients

func NewClients(config restclient.Config, scheme *runtime.Scheme) *Clients

func (*Clients) GetClient

func (c *Clients) GetClient(gv schema.GroupVersion) (restclient.Interface, error)

func (*Clients) GetCodecFactory

func (c *Clients) GetCodecFactory() serializer.CodecFactory

func (*Clients) GetParameterCodec

func (c *Clients) GetParameterCodec() runtime.ParameterCodec

func (*Clients) NewFor

func (c *Clients) NewFor(config restclient.Config) *Clients

type Cluster

type Cluster interface {
	ResourcesSource
	ClusterSource

	GetName() string
	GetId() string
	Config() restclient.Config

	GetAttr(key interface{}) interface{}
	SetAttr(key, value interface{})
}

type ClusterObjectKey

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

func NewClusterKey

func NewClusterKey(cluster string, groupKind schema.GroupKind, namespace, name string) ClusterObjectKey

func NewClusterKeyForObject

func NewClusterKeyForObject(cluster string, key ObjectKey) ClusterObjectKey

func ParseClusterObjectKey

func ParseClusterObjectKey(clusterid string, key string) (ClusterObjectKey, error)

func (ClusterObjectKey) AsRefFor

func (this ClusterObjectKey) AsRefFor(clusterid string) string

func (ClusterObjectKey) Cluster

func (this ClusterObjectKey) Cluster() string

func (ClusterObjectKey) ObjectKey

func (this ClusterObjectKey) ObjectKey() ObjectKey

func (ClusterObjectKey) String

func (this ClusterObjectKey) String() string

type ClusterObjectKeySet

type ClusterObjectKeySet map[ClusterObjectKey]struct{}

func FilterKeysByGroupKinds

func FilterKeysByGroupKinds(keys ClusterObjectKeySet, kinds ...schema.GroupKind) ClusterObjectKeySet

func NewClusterObjectKeSetBySets

func NewClusterObjectKeSetBySets(sets ...ClusterObjectKeySet) ClusterObjectKeySet

func NewClusterObjectKeySet

func NewClusterObjectKeySet(a ...ClusterObjectKey) ClusterObjectKeySet

func NewClusterObjectKeySetByArray

func NewClusterObjectKeySetByArray(a []ClusterObjectKey) ClusterObjectKeySet

func (ClusterObjectKeySet) Add

func (ClusterObjectKeySet) AddAll

func (ClusterObjectKeySet) AddSet

func (ClusterObjectKeySet) AsArray

func (this ClusterObjectKeySet) AsArray() []ClusterObjectKey

func (ClusterObjectKeySet) Contains

func (this ClusterObjectKeySet) Contains(n ClusterObjectKey) bool

func (ClusterObjectKeySet) Copy

func (ClusterObjectKeySet) DiffFrom

func (this ClusterObjectKeySet) DiffFrom(set ClusterObjectKeySet) (add, del ClusterObjectKeySet)

func (ClusterObjectKeySet) Equals

func (this ClusterObjectKeySet) Equals(set ClusterObjectKeySet) bool

func (ClusterObjectKeySet) Remove

func (ClusterObjectKeySet) String

func (this ClusterObjectKeySet) String() string

type ClusterSource

type ClusterSource interface {
	GetCluster() Cluster
}

type EventRecorder

type EventRecorder interface {
	Event(eventtype, reason, message string)

	// Eventf is just like Event, but with Sprintf for the message field.
	Eventf(eventtype, reason, messageFmt string, args ...interface{})

	// PastEventf is just like Eventf, but with an option to specify the event's 'timestamp' field.
	PastEventf(timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{})

	// AnnotatedEventf is just like eventf, but with annotations attached
	AnnotatedEventf(annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{})
}

type GenericFilteredInformerFactory

type GenericFilteredInformerFactory interface {
	GenericInformerFactory
	FilteredInformerFor(gvk schema.GroupVersionKind, namespace string, optionsFunc TweakListOptionsFunc) (GenericInformer, error)
	LookupInformerFor(gvk schema.GroupVersionKind, namespace string) (GenericInformer, error)
}

type GenericInformer

type GenericInformer interface {
	cache.SharedIndexInformer
	Informer() cache.SharedIndexInformer
	Lister() Lister
}

type GenericInformerFactory

type GenericInformerFactory interface {
	InformerFor(gvk schema.GroupVersionKind) (GenericInformer, error)
	Start(stopCh <-chan struct{})
	WaitForCacheSync(stopCh <-chan struct{})
}

type GroupKindProvider

type GroupKindProvider interface {
	GroupKind() schema.GroupKind
}

type GroupKindSet

type GroupKindSet map[schema.GroupKind]struct{}

func NewGroupKindSet

func NewGroupKindSet(a ...schema.GroupKind) GroupKindSet

func NewGroupKindSetByArray

func NewGroupKindSetByArray(a []schema.GroupKind) GroupKindSet

func NewsGroupKindSetBySets

func NewsGroupKindSetBySets(sets ...GroupKindSet) GroupKindSet

func (GroupKindSet) Add

func (this GroupKindSet) Add(n ...schema.GroupKind) GroupKindSet

func (GroupKindSet) AddAll

func (this GroupKindSet) AddAll(n []schema.GroupKind) GroupKindSet

func (GroupKindSet) AddSet

func (this GroupKindSet) AddSet(sets ...GroupKindSet) GroupKindSet

func (GroupKindSet) AsArray

func (this GroupKindSet) AsArray() []schema.GroupKind

func (GroupKindSet) Contains

func (this GroupKindSet) Contains(n schema.GroupKind) bool

func (GroupKindSet) Copy

func (this GroupKindSet) Copy() GroupKindSet

func (GroupKindSet) DiffFrom

func (this GroupKindSet) DiffFrom(set GroupKindSet) (add, del GroupKindSet)

func (GroupKindSet) Equals

func (this GroupKindSet) Equals(set GroupKindSet) bool

func (GroupKindSet) Remove

func (this GroupKindSet) Remove(n schema.GroupKind) GroupKindSet

func (GroupKindSet) String

func (this GroupKindSet) String() string

type I_Object

type I_Object interface {
	Object

	I_modify(status_only, create bool, modifier Modifier) (bool, error)
	I_resource() Internal
}

I_Object is the internal object interface used by the Abstract Object implementation to implement standart object methods.

type Info

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

func (*Info) Group

func (this *Info) Group() string

func (*Info) GroupKind

func (this *Info) GroupKind() schema.GroupKind

func (*Info) GroupVersion

func (this *Info) GroupVersion() schema.GroupVersion

func (*Info) GroupVersionKind

func (this *Info) GroupVersionKind() schema.GroupVersionKind

func (*Info) GroupVersionResource

func (this *Info) GroupVersionResource() schema.GroupVersionResource

func (*Info) HasStatusSubResource

func (this *Info) HasStatusSubResource() bool

func (*Info) HasSubResource

func (this *Info) HasSubResource(name string) bool

func (*Info) InfoString

func (this *Info) InfoString() string

func (*Info) Kind

func (this *Info) Kind() string

func (*Info) Name

func (this *Info) Name() string

func (*Info) Namespaced

func (this *Info) Namespaced() bool

func (*Info) String

func (this *Info) String() string

func (*Info) SubResources

func (this *Info) SubResources() utils.StringSet

func (*Info) Version

func (this *Info) Version() string

type IngressObject

type IngressObject struct {
	Object
}

func GetCachedIngress

func GetCachedIngress(src ResourcesSource, namespace, name string) (*IngressObject, error)

func GetIngress

func GetIngress(src ResourcesSource, namespace, name string) (*IngressObject, error)

func Ingress

func Ingress(o Object) *IngressObject

func (*IngressObject) Ingress

func (this *IngressObject) Ingress() *api.Ingress

type Interface

type Interface interface {
	GroupKindProvider
	ClusterSource
	ResourcesSource

	Name() string
	Namespaced() bool
	GroupVersionKind() schema.GroupVersionKind
	Info() *Info
	ResourceContext() ResourceContext
	AddSelectedEventHandler(eventHandlers ResourceEventHandlerFuncs, namespace string, optionsFunc TweakListOptionsFunc) error
	AddEventHandler(eventHandlers ResourceEventHandlerFuncs) error
	AddRawEventHandler(handlers cache.ResourceEventHandlerFuncs) error

	Wrap(ObjectData) (Object, error)
	New(ObjectName) Object

	GetInto(ObjectName, ObjectData) (Object, error)

	GetCached(interface{}) (Object, error)
	Get_(obj interface{}) (Object, error)
	ListCached(selector labels.Selector) ([]Object, error)
	List(opts metav1.ListOptions) (ret []Object, err error)
	Create(ObjectData) (Object, error)
	CreateOrUpdate(obj ObjectData) (Object, error)
	Update(ObjectData) (Object, error)
	Modify(obj ObjectData, modifier Modifier) (ObjectData, bool, error)
	ModifyByName(obj ObjectDataName, modifier Modifier) (Object, bool, error)
	ModifyStatus(obj ObjectData, modifier Modifier) (ObjectData, bool, error)
	ModifyStatusByName(obj ObjectDataName, modifier Modifier) (Object, bool, error)
	Delete(ObjectData) error
	DeleteByName(ObjectDataName) error

	NormalEventf(name ObjectDataName, reason, msgfmt string, args ...interface{})
	WarningEventf(name ObjectDataName, reason, msgfmt string, args ...interface{})

	Namespace(name string) Namespaced

	IsUnstructured() bool
}

type Internal

type Internal interface {
	Interface

	I_objectType() reflect.Type
	I_listType() reflect.Type

	I_create(data ObjectData) (ObjectData, error)
	I_get(data ObjectData) error
	I_update(data ObjectData) (ObjectData, error)
	I_updateStatus(data ObjectData) (ObjectData, error)
	I_delete(data ObjectDataName) error

	I_modifyByName(name ObjectDataName, status_only, create bool, modifier Modifier) (Object, bool, error)
	I_modify(data ObjectData, status_only, read, create bool, modifier Modifier) (ObjectData, bool, error)

	I_getInformer(namespace string, optionsFunc TweakListOptionsFunc) (GenericInformer, error)
	I_lookupInformer(namespace string) (GenericInformer, error)
	I_list(namespace string) ([]Object, error)
}

type KeyFilter

type KeyFilter func(key ClusterObjectKey) bool

func NewGroupKindFilter

func NewGroupKindFilter(gk schema.GroupKind) KeyFilter

type Lister

type Lister interface {
	List(selector labels.Selector, consumer func(o interface{})) error
	Namespace(namespace string) NamespacedLister
	Get(name string) (ObjectData, error)
}

func NewLister

func NewLister(indexer cache.Indexer, resource *Info) Lister

type ModificationState

type ModificationState struct {
	utils.ModificationState
	// contains filtered or unexported fields
}

func NewModificationState

func NewModificationState(object Object, mod ...bool) *ModificationState

func (*ModificationState) AddOwners

func (this *ModificationState) AddOwners(objs ...Object) *ModificationState

func (*ModificationState) Apply

func (this *ModificationState) Apply(f func(obj Object) bool) *ModificationState

func (*ModificationState) AssureLabel

func (this *ModificationState) AssureLabel(name, value string) *ModificationState

func (*ModificationState) Condition

func (*ModificationState) Data

func (this *ModificationState) Data() ObjectData

func (*ModificationState) Get

func (this *ModificationState) Get(field fieldpath.Field) (interface{}, error)

func (*ModificationState) Object

func (this *ModificationState) Object() Object

func (*ModificationState) Set

func (this *ModificationState) Set(field fieldpath.Field, value interface{}) error

func (*ModificationState) Update

func (this *ModificationState) Update() error

func (*ModificationState) UpdateStatus

func (this *ModificationState) UpdateStatus() error

type Modifier

type Modifier func(ObjectData) (bool, error)

type Namespaced

type Namespaced interface {
	ListCached(selector labels.Selector) ([]Object, error)
	List(opts metav1.ListOptions) (ret []Object, err error)
	GetCached(name string) (Object, error)
	Get(name string) (Object, error)
}

type NamespacedLister

type NamespacedLister interface {
	List(selector labels.Selector, consumer func(o interface{})) error
	Get(name string) (ObjectData, error)
}

type Object

type Object interface {
	metav1.Object
	GroupKindProvider
	//runtime.ObjectData
	EventRecorder
	ResourcesSource
	ClusterSource

	GroupVersionKind() schema.GroupVersionKind
	ObjectName() ObjectName
	Data() ObjectData
	DeepCopy() Object
	Key() ObjectKey
	ClusterKey() ClusterObjectKey
	IsCoLocatedTo(o Object) bool

	GetResource() Interface

	IsA(spec interface{}) bool
	Create() error
	CreateOrUpdate() error
	Delete() error
	Update() error
	UpdateStatus() error
	Modify(modifier Modifier) (bool, error)
	ModifyStatus(modifier Modifier) (bool, error)
	CreateOrModify(modifier Modifier) (bool, error)
	UpdateFromCache() error

	Description() string
	HasFinalizer(key string) bool
	SetFinalizer(key string) error
	RemoveFinalizer(key string) error

	GetLabel(name string) string

	IsDeleting() bool

	GetOwnerReference() *metav1.OwnerReference
	GetOwners(kinds ...schema.GroupKind) ClusterObjectKeySet
	AddOwner(Object) bool
	RemoveOwner(Object) bool
}

func NewObject

func NewObject(data ObjectData, cluster Cluster, resource Internal) Object

type ObjectData

type ObjectData interface {
	metav1.Object
	runtime.Object
}

type ObjectDataName

type ObjectDataName interface {
	GetName() string
	GetNamespace() string
}

type ObjectFilter

type ObjectFilter func(obj Object) bool

type ObjectKey

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

ObjectKey used for worker queues.

func IngressKey

func IngressKey(namespace, name string) ObjectKey

func NewKey

func NewKey(groupKind schema.GroupKind, namespace, name string) ObjectKey

func SecretKey

func SecretKey(namespace, name string) ObjectKey

func SecretKeyByRef

func SecretKeyByRef(ref *api.SecretReference) ObjectKey

func ServiceKey

func ServiceKey(namespace, name string) ObjectKey

func (ObjectKey) ForCluster

func (this ObjectKey) ForCluster(id string) ClusterObjectKey

func (ObjectKey) Group

func (this ObjectKey) Group() string

func (ObjectKey) GroupKind

func (this ObjectKey) GroupKind() schema.GroupKind

func (ObjectKey) Kind

func (this ObjectKey) Kind() string

func (ObjectKey) Name

func (this ObjectKey) Name() string

func (ObjectKey) Namespace

func (this ObjectKey) Namespace() string

func (ObjectKey) ObjectName

func (this ObjectKey) ObjectName() ObjectName

func (ObjectKey) String

func (this ObjectKey) String() string

type ObjectMatcher

type ObjectMatcher func(Object) bool

type ObjectName

type ObjectName interface {
	Name() string
	Namespace() string
	String() string

	ForGroupKind(gk schema.GroupKind) ObjectKey
}

func NewObjectNameFor

func NewObjectNameFor(p ObjectNameProvider) ObjectName

func ParseObjectName

func ParseObjectName(name string) (ObjectName, error)

type ObjectNameProvider

type ObjectNameProvider interface {
	Namespace() string
	Name() string
}

type ObjectNameSet

type ObjectNameSet map[ObjectName]struct{}

func NewObjectNameSet

func NewObjectNameSet(a ...ObjectName) ObjectNameSet

func NewObjectNameSetByArray

func NewObjectNameSetByArray(a []ObjectName) ObjectNameSet

func NewObjectNameSetBySets

func NewObjectNameSetBySets(sets ...ObjectNameSet) ObjectNameSet

func (ObjectNameSet) Add

func (this ObjectNameSet) Add(n ...ObjectName) ObjectNameSet

func (ObjectNameSet) AddAll

func (this ObjectNameSet) AddAll(n []ObjectName) ObjectNameSet

func (ObjectNameSet) AddAllSplitted

func (this ObjectNameSet) AddAllSplitted(n string) (ObjectNameSet, error)

func (ObjectNameSet) AddSet

func (this ObjectNameSet) AddSet(sets ...ObjectNameSet) ObjectNameSet

func (ObjectNameSet) AsArray

func (this ObjectNameSet) AsArray() []ObjectName

func (ObjectNameSet) Contains

func (this ObjectNameSet) Contains(n ObjectName) bool

func (ObjectNameSet) Copy

func (this ObjectNameSet) Copy() ObjectNameSet

func (ObjectNameSet) DiffFrom

func (this ObjectNameSet) DiffFrom(set ObjectNameSet) (add, del ObjectNameSet)

func (ObjectNameSet) Equals

func (this ObjectNameSet) Equals(set ObjectNameSet) bool

func (ObjectNameSet) Remove

func (this ObjectNameSet) Remove(n ObjectName) ObjectNameSet

func (ObjectNameSet) String

func (this ObjectNameSet) String() string

type OwnerDetector

type OwnerDetector func(sub Object) ClusterObjectKeySet

type ResourceContext

type ResourceContext interface {
	GetGroups() []schema.GroupVersion
	GetResourceInfos(gv schema.GroupVersion) []*Info

	GetClient(gv schema.GroupVersion) (restclient.Interface, error)

	Resources() Resources
	SharedInformerFactory() SharedInformerFactory

	GetPreferred(gk schema.GroupKind) (*Info, error)
	Get(gvk schema.GroupVersionKind) (*Info, error)

	GetServerVersion() *semver.Version
}

func NewResourceContext

func NewResourceContext(ctx context.Context, c Cluster, scheme *runtime.Scheme, defaultResync time.Duration) (ResourceContext, error)

type ResourceEventHandlerFuncs

type ResourceEventHandlerFuncs struct {
	AddFunc    func(obj Object)
	UpdateFunc func(oldObj, newObj Object)
	DeleteFunc func(obj Object)
}

type ResourceHelper

type ResourceHelper struct {
	Internal
}

func (*ResourceHelper) CheckOType

func (this *ResourceHelper) CheckOType(obj ObjectData, unstructured ...bool) error

func (*ResourceHelper) CreateData

func (this *ResourceHelper) CreateData(name ...ObjectDataName) ObjectData

func (*ResourceHelper) CreateListData

func (this *ResourceHelper) CreateListData() runtime.Object

func (*ResourceHelper) Get

func (this *ResourceHelper) Get(namespace, name string, result ObjectData) (Object, error)

func (*ResourceHelper) ObjectAsResource

func (this *ResourceHelper) ObjectAsResource(obj ObjectData) Object

type ResourceInfos

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

func NewResourceInfos

func NewResourceInfos(c Cluster) (*ResourceInfos, error)

func (*ResourceInfos) Get

func (this *ResourceInfos) Get(gvk schema.GroupVersionKind) (*Info, error)

func (*ResourceInfos) GetGroups

func (this *ResourceInfos) GetGroups() []schema.GroupVersion

func (*ResourceInfos) GetPreferred

func (this *ResourceInfos) GetPreferred(gk schema.GroupKind) (*Info, error)

func (*ResourceInfos) GetResourceInfos

func (this *ResourceInfos) GetResourceInfos(gv schema.GroupVersion) []*Info

func (*ResourceInfos) GetServerVersion

func (this *ResourceInfos) GetServerVersion() *semver.Version

func (*ResourceInfos) RESTMapping

func (this *ResourceInfos) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)

type Resources

type Resources interface {
	ResourcesSource
	record.EventRecorder

	Get(interface{}) (Interface, error)
	GetByExample(obj runtime.Object) (Interface, error)
	GetByGK(gk schema.GroupKind) (Interface, error)
	GetByGVK(gvk schema.GroupVersionKind) (Interface, error)

	GetUnstructuredByGK(gk schema.GroupKind) (Interface, error)
	GetUnstructuredByGVK(gvk schema.GroupVersionKind) (Interface, error)

	Wrap(obj ObjectData) (Object, error)

	GetObjectInto(ObjectName, ObjectData) (Object, error)

	GetObject(spec interface{}) (Object, error)
	GetCachedObject(spec interface{}) (Object, error)

	CreateObject(ObjectData) (Object, error)
	CreateOrUpdateObject(obj ObjectData) (Object, error)

	DeleteObject(obj ObjectData) error
}

type ResourcesSource

type ResourcesSource interface {
	Resources() Resources
}

type SecretObject

type SecretObject struct {
	Object
}

func GetCachedSecret

func GetCachedSecret(src ResourcesSource, namespace, name string) (*SecretObject, error)

func GetCachedSecretByRef

func GetCachedSecretByRef(src ResourcesSource, ref *api.SecretReference) (*SecretObject, error)

func GetCachedSecretProperties

func GetCachedSecretProperties(src ResourcesSource, namespace, name string) (utils.Properties, *SecretObject, error)

func GetCachedSecretPropertiesByRef

func GetCachedSecretPropertiesByRef(src ResourcesSource, ref *api.SecretReference) (utils.Properties, *SecretObject, error)

func GetSecret

func GetSecret(src ResourcesSource, namespace, name string) (*SecretObject, error)

func GetSecretByRef

func GetSecretByRef(src ResourcesSource, ref *api.SecretReference) (*SecretObject, error)

func GetSecretProperties

func GetSecretProperties(src ResourcesSource, namespace, name string) (utils.Properties, *SecretObject, error)

func GetSecretPropertiesByRef

func GetSecretPropertiesByRef(src ResourcesSource, ref *api.SecretReference) (utils.Properties, *SecretObject, error)

func Secret

func Secret(o Object) *SecretObject

func (*SecretObject) GetData

func (this *SecretObject) GetData() map[string][]byte

func (*SecretObject) Secret

func (this *SecretObject) Secret() *api.Secret

type ServiceObject

type ServiceObject struct {
	Object
}

func GetCachedService

func GetCachedService(src ResourcesSource, namespace, name string) (*ServiceObject, error)

func GetService

func GetService(src ResourcesSource, namespace, name string) (*ServiceObject, error)

func Service

func Service(o Object) *ServiceObject

func (*ServiceObject) Service

func (this *ServiceObject) Service() *api.Service

func (*ServiceObject) Spec

func (this *ServiceObject) Spec() *api.ServiceSpec

func (*ServiceObject) Status

func (this *ServiceObject) Status() *api.ServiceStatus

type SharedInformerFactory

type SharedInformerFactory interface {
	Structured() GenericFilteredInformerFactory
	Unstructured() GenericFilteredInformerFactory

	InformerForObject(obj runtime.Object) (GenericInformer, error)
	FilteredInformerForObject(obj runtime.Object, namespace string, optionsFunc TweakListOptionsFunc) (GenericInformer, error)

	InformerFor(gvk schema.GroupVersionKind) (GenericInformer, error)
	FilteredInformerFor(gvk schema.GroupVersionKind, namespace string, optionsFunc TweakListOptionsFunc) (GenericInformer, error)

	UnstructuredInformerFor(gvk schema.GroupVersionKind) (GenericInformer, error)
	FilteredUnstructuredInformerFor(gvk schema.GroupVersionKind, namespace string, optionsFunc TweakListOptionsFunc) (GenericInformer, error)

	Start(stopCh <-chan struct{})
	WaitForCacheSync(stopCh <-chan struct{})
}

SharedInformerFactory provides shared informers for resources in all known API group versions.

type SlaveCache

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

func NewSlaveCache

func NewSlaveCache() *SlaveCache

func (*SlaveCache) AddOwnerFilter

func (this *SlaveCache) AddOwnerFilter(filters ...KeyFilter) *SlaveCache

func (*SlaveCache) AddSlave

func (this *SlaveCache) AddSlave(obj Object, slave Object) error

func (*SlaveCache) AddSlaveFilter

func (this *SlaveCache) AddSlaveFilter(filters ...ObjectFilter) *SlaveCache

func (*SlaveCache) CreateSlave

func (this *SlaveCache) CreateSlave(obj Object, slave Object) error

func (*SlaveCache) DeleteOwner

func (this *SlaveCache) DeleteOwner(key ClusterObjectKey)

func (*SlaveCache) DeleteSlave

func (this *SlaveCache) DeleteSlave(key ClusterObjectKey)

func (*SlaveCache) Get

func (this *SlaveCache) Get(obj Object) []Object

Get is replaced by GetByOwner Deprecated: Please use GetByOwner

func (*SlaveCache) GetByKey

func (this *SlaveCache) GetByKey(key ClusterObjectKey) []Object

GetByKey is replaced by GetByOwnerKey Deprecated: Please use GetByOwnerKey

func (*SlaveCache) GetByOwner

func (this *SlaveCache) GetByOwner(obj Object) []Object

func (*SlaveCache) GetByOwnerKey

func (this *SlaveCache) GetByOwnerKey(key ClusterObjectKey) []Object

func (*SlaveCache) GetOwners

func (this *SlaveCache) GetOwners(kinds ...schema.GroupKind) ClusterObjectKeySet

func (*SlaveCache) GetOwnersFor

func (this *SlaveCache) GetOwnersFor(key ClusterObjectKey, kinds ...schema.GroupKind) ClusterObjectKeySet

func (*SlaveCache) GetSlave

func (this *SlaveCache) GetSlave(key ClusterObjectKey) Object

func (*SlaveCache) Remove

func (this *SlaveCache) Remove(obj Object, slave Object) bool

func (*SlaveCache) RenewSlaveObject

func (this *SlaveCache) RenewSlaveObject(obj Object) bool

func (*SlaveCache) Setup

func (this *SlaveCache) Setup(slaves []Object)

func (*SlaveCache) Size

func (this *SlaveCache) Size() int

func (*SlaveCache) SlaveCount

func (this *SlaveCache) SlaveCount() int

func (*SlaveCache) UpdateSlave

func (this *SlaveCache) UpdateSlave(obj Object) error

type SubObjectCache

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

func NewSubObjectCache

func NewSubObjectCache(o OwnerDetector) *SubObjectCache

func (*SubObjectCache) AddOwnerFilter

func (this *SubObjectCache) AddOwnerFilter(filters ...KeyFilter) *SubObjectCache

func (*SubObjectCache) AddSubObjectFilter

func (this *SubObjectCache) AddSubObjectFilter(filters ...ObjectFilter) *SubObjectCache

func (*SubObjectCache) CreateSubObject

func (this *SubObjectCache) CreateSubObject(sub Object) error

func (*SubObjectCache) DeleteOwner

func (this *SubObjectCache) DeleteOwner(key ClusterObjectKey)

func (*SubObjectCache) DeleteSubObject

func (this *SubObjectCache) DeleteSubObject(key ClusterObjectKey)

func (*SubObjectCache) Get

func (this *SubObjectCache) Get(obj Object) []Object

Get is replaced by GetByOwner Deprecated: Please use GetByOwner

func (*SubObjectCache) GetAllOwners

func (this *SubObjectCache) GetAllOwners(kind ...schema.GroupKind) ClusterObjectKeySet

func (*SubObjectCache) GetByKey

func (this *SubObjectCache) GetByKey(key ClusterObjectKey) []Object

GetByKey is replaced by GetByOwnerKey Deprecated: Please use GetByOwnerKey

func (*SubObjectCache) GetByOwner

func (this *SubObjectCache) GetByOwner(obj Object) []Object

func (*SubObjectCache) GetByOwnerKey

func (this *SubObjectCache) GetByOwnerKey(key ClusterObjectKey) []Object

func (*SubObjectCache) GetOwners

func (this *SubObjectCache) GetOwners(key ClusterObjectKey, kinds ...schema.GroupKind) ClusterObjectKeySet

func (*SubObjectCache) GetSubObject

func (this *SubObjectCache) GetSubObject(key ClusterObjectKey) Object

func (*SubObjectCache) RenewSubObject

func (this *SubObjectCache) RenewSubObject(obj Object) bool

func (*SubObjectCache) Setup

func (this *SubObjectCache) Setup(subObjects []Object)

func (*SubObjectCache) Size

func (this *SubObjectCache) Size() int

func (*SubObjectCache) SubObjectCount

func (this *SubObjectCache) SubObjectCount() int

func (*SubObjectCache) UpdateSubObject

func (this *SubObjectCache) UpdateSubObject(obj Object) error

type TweakListOptionsFunc

type TweakListOptionsFunc func(*metav1.ListOptions)

TweakListOptionsFunc defines the signature of a helper function that wants to provide more listing options to API

type UsageCache

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

func NewUsageCache

func NewUsageCache(u UsedExtractor) *UsageCache

func (*UsageCache) AddOwnerFilter

func (this *UsageCache) AddOwnerFilter(filters ...KeyFilter) *UsageCache

func (*UsageCache) DeleteOwner

func (this *UsageCache) DeleteOwner(key ClusterObjectKey)

func (*UsageCache) GetOwners

func (this *UsageCache) GetOwners() ClusterObjectKeySet

func (*UsageCache) GetOwnersFor

func (this *UsageCache) GetOwnersFor(key ClusterObjectKey, kinds ...schema.GroupKind) ClusterObjectKeySet

func (*UsageCache) GetUsages

func (this *UsageCache) GetUsages(key ClusterObjectKey) ClusterObjectKeySet

func (*UsageCache) GetUsed

func (this *UsageCache) GetUsed() ClusterObjectKeySet

func (*UsageCache) RenewOwner

func (this *UsageCache) RenewOwner(obj Object) bool

func (*UsageCache) Setup

func (this *UsageCache) Setup(owners []Object)

func (*UsageCache) Size

func (this *UsageCache) Size() int

func (*UsageCache) UsedCount

func (this *UsageCache) UsedCount() int

type UsedExtractor

type UsedExtractor func(sub Object) ClusterObjectKeySet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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