Documentation ¶
Index ¶
- Variables
- type Client
- type ClientAdapter
- type ObjectUpdater
- func ClusterRoleBindingUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, ...) ObjectUpdater
- func ClusterRoleUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, ...) ObjectUpdater
- func ConfigMapUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, ...) ObjectUpdater
- func NamespaceUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, ...) ObjectUpdater
- func RoleBindingUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, ...) ObjectUpdater
- func (o *ObjectUpdater) Create(logger *zap.Logger, obj runtime.Object) (conflictRet, retriableRet bool, result runtime.Object, err error)
- func (o *ObjectUpdater) CreateOrUpdate(logger *zap.Logger, updatePrecondition func(runtime.Object) error, ...) (conflictRet, retriableRet bool, result runtime.Object, err error)
- func (o *ObjectUpdater) Delete(logger *zap.Logger, ns, name string, options *meta_v1.DeleteOptions) (conflictRet, retriableRet bool, err error)
- func (o *ObjectUpdater) DeleteAndGet(logger *zap.Logger, ns, name string) (conflictRet, retriableRet bool, obj runtime.Object, err error)
- func (o *ObjectUpdater) Get(logger *zap.Logger, ns, name string) (result runtime.Object, exists bool, err error)
- func (o *ObjectUpdater) Update(logger *zap.Logger, desired, existing runtime.Object) (conflictRet, retriableRet bool, result runtime.Object, err error)
- type SpecCheck
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NonRetriableErrors = [...]func(error) bool{ api_errors.IsResourceExpired, api_errors.IsMethodNotSupported, api_errors.IsNotAcceptable, api_errors.IsUnsupportedMediaType, api_errors.IsBadRequest, api_errors.IsInvalid, } )
Functions ¶
This section is empty.
Types ¶
type ClientAdapter ¶
type ClientAdapter struct { CreateMethod func(ns string, obj runtime.Object) (runtime.Object, error) UpdateMethod func(ns string, obj runtime.Object) (runtime.Object, error) DeleteMethod func(ns string, name string, options *meta_v1.DeleteOptions) error }
func (ClientAdapter) Delete ¶
func (p ClientAdapter) Delete(ns string, name string, options *meta_v1.DeleteOptions) error
type ObjectUpdater ¶
type ObjectUpdater struct { ExistingObjectsIndexer cache.Indexer Client Client SpecCheck SpecCheck }
func ClusterRoleBindingUpdater ¶
func ClusterRoleBindingUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, client kubernetes.Interface) ObjectUpdater
func ClusterRoleUpdater ¶
func ClusterRoleUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, client kubernetes.Interface) ObjectUpdater
func ConfigMapUpdater ¶
func ConfigMapUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, client kubernetes.Interface) ObjectUpdater
func NamespaceUpdater ¶
func NamespaceUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, client kubernetes.Interface) ObjectUpdater
func RoleBindingUpdater ¶
func RoleBindingUpdater(existingObjectsIndexer cache.Indexer, specCheck SpecCheck, client kubernetes.Interface) ObjectUpdater
func (*ObjectUpdater) CreateOrUpdate ¶
func (o *ObjectUpdater) CreateOrUpdate(logger *zap.Logger, updatePrecondition func(runtime.Object) error, obj runtime.Object) (conflictRet, retriableRet bool, result runtime.Object, err error)
CreateOrUpdate given the object to create/update, and the owner of the object will attempt to create or update the object, only if the owner matches the object. In the case of updates, it will only update if the object has changed. This returns one of four possible exclusive states: 1. Conflict - object in k8s conflicts with update or create. Conflict is true. 2. Precondition Failed Error - Precondition failed. Error is copied from updatePrecondition function. 3. Error with Retriable flag - An error happened, and if it is retriable. 4. Success - Successfully created or updated the object. It is returned.
func (*ObjectUpdater) Delete ¶
func (o *ObjectUpdater) Delete(logger *zap.Logger, ns, name string, options *meta_v1.DeleteOptions) (conflictRet, retriableRet bool, err error)
func (*ObjectUpdater) DeleteAndGet ¶
Click to show internal directories.
Click to hide internal directories.