arm

package
v2.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PollerResumeTokenAnnotation = "serviceoperator.azure.com/poller-resume-token"
	PollerResumeIDAnnotation    = "serviceoperator.azure.com/poller-resume-id"
)
View Source
const (
	CreateOrUpdateActionNoAction        = CreateOrUpdateAction("NoAction")
	CreateOrUpdateActionClaimResource   = CreateOrUpdateAction("ClaimResource")
	CreateOrUpdateActionBeginCreation   = CreateOrUpdateAction("BeginCreateOrUpdate")
	CreateOrUpdateActionMonitorCreation = CreateOrUpdateAction("MonitorCreateOrUpdate")
)
View Source
const (
	DeleteActionBeginDelete   = DeleteAction("BeginDelete")
	DeleteActionMonitorDelete = DeleteAction("MonitorDelete")
)
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"

TODO: Do we actually want this at the controller level or this level?

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

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 NoAction

func NoAction(_ context.Context) (ctrl.Result, error)

func SetPollerResumeToken

func SetPollerResumeToken(obj genruntime.MetaObject, id string, token string)

Types

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

type CreateOrUpdateAction

type CreateOrUpdateAction string

type CreateOrUpdateActionFunc

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

type DeleteAction

type DeleteAction string

type DeleteActionFunc

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

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

Jump to

Keyboard shortcuts

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