Documentation ¶
Index ¶
- func CreateOnlyMutator(_, _ client.Object) (bool, error)
- func DeploymentImageMutator(desired, existing *appsv1.Deployment) bool
- type BaseReconciler
- func (b *BaseReconciler) APIClientReader() client.Reader
- func (b *BaseReconciler) AddFinalizer(ctx context.Context, obj client.Object, finalizer string) error
- func (b *BaseReconciler) Client() client.Client
- func (b *BaseReconciler) CreateResource(ctx context.Context, obj client.Object) error
- func (b *BaseReconciler) DeleteResource(ctx context.Context, obj client.Object, options ...client.DeleteOption) error
- func (b *BaseReconciler) GetResource(ctx context.Context, objKey types.NamespacedName, obj client.Object) error
- func (b *BaseReconciler) Logger() logr.Logger
- func (b *BaseReconciler) Reconcile(context.Context, ctrl.Request) (ctrl.Result, error)
- func (b *BaseReconciler) ReconcileResource(ctx context.Context, obj, desired client.Object, mutateFn MutateFn) error
- func (b *BaseReconciler) ReconcileResourceStatus(ctx context.Context, objKey client.ObjectKey, obj client.Object, ...) error
- func (b *BaseReconciler) RemoveFinalizer(ctx context.Context, obj client.Object, finalizer string) error
- func (b *BaseReconciler) Scheme() *runtime.Scheme
- func (b *BaseReconciler) UpdateResource(ctx context.Context, obj client.Object) error
- func (b *BaseReconciler) UpdateResourceStatus(ctx context.Context, obj client.Object) error
- type DeploymentMutateFn
- type MutateFn
- type StatusMeta
- type StatusMutator
- type StatusMutatorFunc
- type TypedMutateFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeploymentImageMutator ¶
func DeploymentImageMutator(desired, existing *appsv1.Deployment) bool
Types ¶
type BaseReconciler ¶
type BaseReconciler struct {
// contains filtered or unexported fields
}
func NewBaseReconciler ¶
func (*BaseReconciler) APIClientReader ¶
func (b *BaseReconciler) APIClientReader() client.Reader
APIClientReader return a client that directly reads objects from the Kubernetes APIServer
func (*BaseReconciler) AddFinalizer ¶
func (*BaseReconciler) Client ¶
func (b *BaseReconciler) Client() client.Client
Client returns a split client that reads objects from the cache and writes to the Kubernetes APIServer
func (*BaseReconciler) CreateResource ¶
func (*BaseReconciler) DeleteResource ¶
func (b *BaseReconciler) DeleteResource(ctx context.Context, obj client.Object, options ...client.DeleteOption) error
func (*BaseReconciler) GetResource ¶
func (b *BaseReconciler) GetResource(ctx context.Context, objKey types.NamespacedName, obj client.Object) error
func (*BaseReconciler) Logger ¶
func (b *BaseReconciler) Logger() logr.Logger
func (*BaseReconciler) ReconcileResource ¶
func (b *BaseReconciler) ReconcileResource(ctx context.Context, obj, desired client.Object, mutateFn MutateFn) error
ReconcileResource attempts to mutate the existing state in order to match the desired state. The object's desired state must be reconciled with the existing state inside the passed in callback MutateFn.
obj: Object of the same type as the 'desired' object.
Used to read the resource from the kubernetes cluster. Could be zero-valued initialized object.
desired: Object representing the desired state
It returns an error.
func (*BaseReconciler) ReconcileResourceStatus ¶
func (b *BaseReconciler) ReconcileResourceStatus(ctx context.Context, objKey client.ObjectKey, obj client.Object, mutator StatusMutator) error
func (*BaseReconciler) RemoveFinalizer ¶
func (*BaseReconciler) Scheme ¶
func (b *BaseReconciler) Scheme() *runtime.Scheme
func (*BaseReconciler) UpdateResource ¶
func (*BaseReconciler) UpdateResourceStatus ¶
type DeploymentMutateFn ¶
type DeploymentMutateFn func(desired, existing *appsv1.Deployment) bool
DeploymentMutateFn is a function which mutates the existing Deployment into it's desired state.
type MutateFn ¶
MutateFn is a function which mutates the existing object into it's desired state.
func DeploymentMutator ¶
func DeploymentMutator(opts ...DeploymentMutateFn) MutateFn
type StatusMeta ¶
type StatusMeta struct { // ObservedGeneration reflects the generation of the most recently observed spec. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` }
func (*StatusMeta) GetObservedGeneration ¶
func (meta *StatusMeta) GetObservedGeneration() int64
func (*StatusMeta) SetObservedGeneration ¶
func (meta *StatusMeta) SetObservedGeneration(o int64)
type StatusMutator ¶
StatusMutator is an interface to hold mutator functions for status updates.
type StatusMutatorFunc ¶
StatusMutatorFunc is a function adaptor for StatusMutators.
type TypedMutateFn ¶
TypedMutateFn is a function which mutates the existing T into it's desired state.