Documentation ¶
Index ¶
- Constants
- func ARMReconcilerAnnotationChangedPredicate(log logr.Logger) predicate.Predicate
- func ClassifyCloudError(err *genericarmclient.CloudError) (core.CloudErrorDetails, error)
- func ClassifyResolverError(err error) error
- func ClearPollerResumeToken(obj genruntime.MetaObject)
- func CommitObject(ctx context.Context, kubeClient kubeclient.Client, obj genruntime.MetaObject) error
- func ConvertToARMResourceImpl(ctx context.Context, metaObject genruntime.MetaObject, scheme *runtime.Scheme, ...) (genruntime.ARMResource, error)
- func GetPollerResumeToken(obj genruntime.MetaObject) (string, string, bool)
- func HasReconcilePolicyAnnotationChanged(old *string, new *string) bool
- func IgnoreNotFoundAndConflict(err error) error
- func NoAction(_ context.Context) (ctrl.Result, error)
- func SetPollerResumeToken(obj genruntime.MetaObject, id string, token string)
- type ARMClientFactory
- type AzureDeploymentReconciler
- type CreateOrUpdateAction
- type CreateOrUpdateActionFunc
- type DeleteAction
- type DeleteActionFunc
- type ReconcilePolicy
Constants ¶
const ( PollerResumeTokenAnnotation = "serviceoperator.azure.com/poller-resume-token" PollerResumeIDAnnotation = "serviceoperator.azure.com/poller-resume-id" )
const ( CreateOrUpdateActionNoAction = CreateOrUpdateAction("NoAction") CreateOrUpdateActionClaimResource = CreateOrUpdateAction("ClaimResource") CreateOrUpdateActionBeginCreation = CreateOrUpdateAction("BeginCreateOrUpdate") CreateOrUpdateActionMonitorCreation = CreateOrUpdateAction("MonitorCreateOrUpdate") )
const ( DeleteActionBeginDelete = DeleteAction("BeginDelete") DeleteActionMonitorDelete = DeleteAction("MonitorDelete") )
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") )
const GenericControllerFinalizer = "serviceoperator.azure.com/finalizer"
TODO: Do we actually want this at the controller level or this level?
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 ¶
ARMReconcilerAnnotationChangedPredicate creates a predicate that emits events when annotations interesting to the generic ARM reconciler are changed
func ClassifyCloudError ¶
func ClassifyCloudError(err *genericarmclient.CloudError) (core.CloudErrorDetails, error)
func ClassifyResolverError ¶
func ClearPollerResumeToken ¶
func ClearPollerResumeToken(obj genruntime.MetaObject)
ClearPollerResumeToken clears the poller resume token and ID annotations
func CommitObject ¶
func CommitObject(ctx context.Context, kubeClient kubeclient.Client, obj genruntime.MetaObject) error
CommitObject persists the contents of obj to etcd by using the Kubernetes client. Note that after this method has been called, obj contains the result of the update from APIServer (including an updated resourceVersion).
func ConvertToARMResourceImpl ¶
func ConvertToARMResourceImpl( ctx context.Context, metaObject genruntime.MetaObject, scheme *runtime.Scheme, resolver *resolver.Resolver, subscriptionID string) (genruntime.ARMResource, error)
ConvertToARMResourceImpl factored out of AzureDeploymentReconciler.ConvertResourceToARMResource to allow for testing
func GetPollerResumeToken ¶
func GetPollerResumeToken(obj genruntime.MetaObject) (string, string, bool)
GetPollerResumeToken returns a poller ID and the poller token
func HasReconcilePolicyAnnotationChanged ¶
HasReconcilePolicyAnnotationChanged returns true if the reconcile-policy annotation has changed in a way that needs to trigger a reconcile.
func SetPollerResumeToken ¶
func SetPollerResumeToken(obj genruntime.MetaObject, id string, token string)
Types ¶
type ARMClientFactory ¶
type ARMClientFactory func(genruntime.MetaObject) *genericarmclient.GenericClient
type AzureDeploymentReconciler ¶
type AzureDeploymentReconciler struct { Recorder record.EventRecorder ARMClientFactory ARMClientFactory KubeClient kubeclient.Client ResourceResolver *resolver.Resolver PositiveConditions *conditions.PositiveConditionBuilder Config config.Values Rand *rand.Rand Extension genruntime.ResourceExtension }
func NewAzureDeploymentReconciler ¶
func NewAzureDeploymentReconciler( armClientFactory ARMClientFactory, eventRecorder record.EventRecorder, kubeClient kubeclient.Client, resourceResolver *resolver.Resolver, positiveConditions *conditions.PositiveConditionBuilder, cfg config.Values, rand *rand.Rand, extension genruntime.ResourceExtension) *AzureDeploymentReconciler
func (*AzureDeploymentReconciler) Reconcile ¶
func (r *AzureDeploymentReconciler) Reconcile(ctx context.Context, log logr.Logger, obj genruntime.MetaObject) (ctrl.Result, error)
type CreateOrUpdateAction ¶
type CreateOrUpdateAction string
type DeleteAction ¶
type DeleteAction string
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