updater

package
v0.0.0-...-e0434a4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Client

type Client interface {
	Create(ns string, obj runtime.Object) (runtime.Object, error)
	Update(ns string, obj runtime.Object) (runtime.Object, error)
	Delete(ns string, name string, options *meta_v1.DeleteOptions) error
}

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) Create

func (p ClientAdapter) Create(ns string, obj runtime.Object) (runtime.Object, error)

func (ClientAdapter) Delete

func (p ClientAdapter) Delete(ns string, name string, options *meta_v1.DeleteOptions) error

func (ClientAdapter) Update

func (p ClientAdapter) Update(ns string, obj runtime.Object) (runtime.Object, 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) Create

func (o *ObjectUpdater) Create(logger *zap.Logger, obj runtime.Object) (conflictRet, retriableRet bool, result runtime.Object, err error)

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

func (o *ObjectUpdater) DeleteAndGet(logger *zap.Logger, ns, name string) (conflictRet, retriableRet bool, obj runtime.Object, err error)

func (*ObjectUpdater) Get

func (o *ObjectUpdater) Get(logger *zap.Logger, ns, name string) (result runtime.Object, exists bool, err error)

func (*ObjectUpdater) Update

func (o *ObjectUpdater) Update(logger *zap.Logger, desired, existing runtime.Object) (conflictRet, retriableRet bool, result runtime.Object, err error)

type SpecCheck

type SpecCheck interface {
	CompareActualVsSpec(logger *zap.Logger, spec, actual runtime.Object) (*unstructured.Unstructured, bool, string, error)
}

Jump to

Keyboard shortcuts

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