reconcilers

package
v2.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReconcilePolicyManage instructs the operator to manage the resource in question.
	// This includes issuing PUTs to update it and DELETE's to delete it from Azure if deleted in Kuberentes.
	// This is the default policy when no policy is specified.
	ReconcilePolicyManage = ReconcilePolicy("manage")

	// ReconcilePolicySkip instructs the operator to skip all reconciliation actions. This includes creating
	// the resource.
	ReconcilePolicySkip = ReconcilePolicy("skip")

	// ReconcilePolicyDetachOnDelete instructs the operator to skip deletion of resources in Azure. This allows
	// deletion of the resource in Kubernetes to go through but does not delete the underlying Azure resource.
	ReconcilePolicyDetachOnDelete = ReconcilePolicy("detach-on-delete")
)
View Source
const GenericControllerFinalizer = "serviceoperator.azure.com/finalizer"
View Source
const ReconcilePolicyAnnotation = "serviceoperator.azure.com/reconcile-policy"

ReconcilePolicyAnnotation describes the reconcile policy for the resource in question. A reconcile policy describes what action (if any) the operator is allowed to take when reconciling the resource. If no reconcile policy is specified, the default is "run"

Variables

This section is empty.

Functions

func ARMReconcilerAnnotationChangedPredicate

func ARMReconcilerAnnotationChangedPredicate(log logr.Logger) predicate.Predicate

ARMReconcilerAnnotationChangedPredicate creates a predicate that emits events when annotations interesting to the generic ARM reconciler are changed

func ClassifyResolverError

func ClassifyResolverError(err error) error

func HasReconcilePolicyAnnotationChanged

func HasReconcilePolicyAnnotationChanged(old *string, new *string) bool

HasReconcilePolicyAnnotationChanged returns true if the reconcile-policy annotation has changed in a way that needs to trigger a reconcile.

func IgnoreNotFoundAndConflict

func IgnoreNotFoundAndConflict(err error) error

func LogObj

func LogObj(log logr.Logger, note string, obj genruntime.MetaObject)

LogObj logs the obj

Types

type ARMOwnedResourceReconcilerCommon

type ARMOwnedResourceReconcilerCommon struct {
	ReconcilerCommon
	ResourceResolver *resolver.Resolver
}

func (*ARMOwnedResourceReconcilerCommon) ApplyOwnership

func (*ARMOwnedResourceReconcilerCommon) ClaimResource

ClaimResource adds a finalizer and ensures that the owner reference is set

func (*ARMOwnedResourceReconcilerCommon) NeedToClaimResource

func (*ARMOwnedResourceReconcilerCommon) NeedsToWaitForOwner

NeedsToWaitForOwner returns false if the owner doesn't need to be waited for, and true if it does.

type ActionFunc

type ActionFunc = func(ctx context.Context) (ctrl.Result, error)

TODO: It's not clear to me that this file holds any value...

type ReconcilePolicy

type ReconcilePolicy string

func GetReconcilePolicy

func GetReconcilePolicy(obj genruntime.MetaObject, log logr.Logger) ReconcilePolicy

GetReconcilePolicy gets the reconcile policy from the ReconcilePolicyAnnotation

func ParseReconcilePolicy

func ParseReconcilePolicy(policy string) (ReconcilePolicy, error)

ParseReconcilePolicy parses the provided reconcile policy.

func (ReconcilePolicy) AllowsDelete

func (r ReconcilePolicy) AllowsDelete() bool

AllowsDelete determines if the policy allows deletion of the backing Azure resource

func (ReconcilePolicy) AllowsModify

func (r ReconcilePolicy) AllowsModify() bool

AllowsModify determines if the policy allows modification of the backing Azure resource

type ReconcilerCommon

type ReconcilerCommon struct {
	KubeClient         kubeclient.Client
	PositiveConditions *conditions.PositiveConditionBuilder
}

func (*ReconcilerCommon) CommitUpdate

func (r *ReconcilerCommon) CommitUpdate(ctx context.Context, log logr.Logger, obj genruntime.MetaObject) error

func (*ReconcilerCommon) RemoveResourceFinalizer

func (r *ReconcilerCommon) RemoveResourceFinalizer(ctx context.Context, log logr.Logger, obj genruntime.MetaObject) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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