Documentation ¶
Index ¶
- Constants
- func NewAzureDeploymentReconciler(metaObj genruntime.MetaObject, log logr.Logger, armClient armclient.Applier, ...) genruntime.Reconciler
- func NoAction(_ context.Context) (ctrl.Result, error)
- func TranslateAzureErrorToDeploymentError(err *azure.RequestError) *armclient.DeploymentError
- type AzureDeploymentReconciler
- func (r *AzureDeploymentReconciler) CommitUpdate(ctx context.Context) error
- func (r *AzureDeploymentReconciler) CreateDeployment(ctx context.Context) (ctrl.Result, error)
- func (r *AzureDeploymentReconciler) CreateOrUpdate(ctx context.Context) (ctrl.Result, error)
- func (r *AzureDeploymentReconciler) Delete(ctx context.Context) (ctrl.Result, error)
- func (r *AzureDeploymentReconciler) DetermineCreateOrUpdateAction() (CreateOrUpdateAction, CreateOrUpdateActionFunc, error)
- func (r *AzureDeploymentReconciler) DetermineDeleteAction() (DeleteAction, DeleteActionFunc, error)
- func (r *AzureDeploymentReconciler) GetDeploymentID() (string, bool)
- func (r *AzureDeploymentReconciler) GetDeploymentIDOrDefault() string
- func (r *AzureDeploymentReconciler) GetDeploymentName() (string, bool)
- func (r *AzureDeploymentReconciler) GetDeploymentNameOrDefault() string
- func (r *AzureDeploymentReconciler) GetReadyCondition() *conditions.Condition
- func (r *AzureDeploymentReconciler) HasResourceSpecHashChanged() (bool, error)
- func (r *AzureDeploymentReconciler) InTerminalState() bool
- func (r *AzureDeploymentReconciler) ManageOwnership(ctx context.Context) (ctrl.Result, error)
- func (r *AzureDeploymentReconciler) MonitorDelete(ctx context.Context) (ctrl.Result, error)
- func (r *AzureDeploymentReconciler) MonitorDeployment(ctx context.Context) (ctrl.Result, error)
- func (r *AzureDeploymentReconciler) Reconcile(ctx context.Context) (ctrl.Result, error)
- func (r *AzureDeploymentReconciler) SetDeploymentID(id string)
- func (r *AzureDeploymentReconciler) SetDeploymentName(name string)
- func (r *AzureDeploymentReconciler) SetResourceSignature(sig string)
- func (r *AzureDeploymentReconciler) SpecSignature() (string, error)
- func (r *AzureDeploymentReconciler) StartDeleteOfResource(ctx context.Context) (ctrl.Result, error)
- func (r *AzureDeploymentReconciler) Update(deployment *armclient.Deployment, status genruntime.FromARMConverter) error
- func (r *AzureDeploymentReconciler) UpdateBeforeCreatingDeployment(deploymentName string, deploymentID string) error
- type CreateOrUpdateAction
- type CreateOrUpdateActionFunc
- type DeleteAction
- type DeleteActionFunc
- type DeploymentErrorClassification
- type DeploymentErrorDetails
- type FatalReconciliationError
Constants ¶
const ( // TODO: Delete these later in favor of something in status? DeploymentIDAnnotation = "deployment-id.azure.com" DeploymentNameAnnotation = "deployment-name.azure.com" ResourceSigAnnotationKey = "resource-sig.azure.com" )
const ( CreateOrUpdateActionNoAction = CreateOrUpdateAction("NoAction") CreateOrUpdateActionManageOwnership = CreateOrUpdateAction("ManageOwnership") CreateOrUpdateActionBeginDeployment = CreateOrUpdateAction("BeginDeployment") CreateOrUpdateActionMonitorDeployment = CreateOrUpdateAction("MonitorDeployment") )
const ( DeleteActionBeginDelete = DeleteAction("BeginDelete") DeleteActionMonitorDelete = DeleteAction("MonitorDelete") )
const ( DeploymentErrorRetryable = DeploymentErrorClassification("retryable") DeploymentErrorFatal = DeploymentErrorClassification("fatal") )
const ( UnknownErrorCode = "UnknownError" UnknownErrorMessage = "There was an unknown deployment error" )
const GenericControllerFinalizer = "serviceoperator.azure.com/finalizer"
TODO: Do we actually want this at the controller level or this level?
Variables ¶
This section is empty.
Functions ¶
func NewAzureDeploymentReconciler ¶
func NewAzureDeploymentReconciler( metaObj genruntime.MetaObject, log logr.Logger, armClient armclient.Applier, eventRecorder record.EventRecorder, kubeClient *kubeclient.Client, resourceResolver *genruntime.Resolver, positiveConditions *conditions.PositiveConditionBuilder, createDeploymentName func(obj metav1.Object) (string, error)) genruntime.Reconciler
TODO: It's a bit weird that this is a "reconciler" that operates only on a specific genruntime.MetaObject. TODO: We probably want to refactor this to make metaObj a parameter?
func TranslateAzureErrorToDeploymentError ¶
func TranslateAzureErrorToDeploymentError(err *azure.RequestError) *armclient.DeploymentError
Types ¶
type AzureDeploymentReconciler ¶
type AzureDeploymentReconciler struct { ARMClient armclient.Applier KubeClient *kubeclient.Client ResourceResolver *genruntime.Resolver PositiveConditions *conditions.PositiveConditionBuilder CreateDeploymentName func(obj metav1.Object) (string, error) // contains filtered or unexported fields }
func (*AzureDeploymentReconciler) CommitUpdate ¶
func (r *AzureDeploymentReconciler) CommitUpdate(ctx context.Context) error
CommitUpdate persists the contents of r.obj to etcd by using the Kubernetes client. Note that after this method has been called, r.obj contains the result of the update from APIServer (including an updated resourceVersion).
func (*AzureDeploymentReconciler) CreateDeployment ¶
func (*AzureDeploymentReconciler) CreateOrUpdate ¶
func (*AzureDeploymentReconciler) DetermineCreateOrUpdateAction ¶
func (r *AzureDeploymentReconciler) DetermineCreateOrUpdateAction() (CreateOrUpdateAction, CreateOrUpdateActionFunc, error)
func (*AzureDeploymentReconciler) DetermineDeleteAction ¶
func (r *AzureDeploymentReconciler) DetermineDeleteAction() (DeleteAction, DeleteActionFunc, error)
func (*AzureDeploymentReconciler) GetDeploymentID ¶
func (r *AzureDeploymentReconciler) GetDeploymentID() (string, bool)
func (*AzureDeploymentReconciler) GetDeploymentIDOrDefault ¶
func (r *AzureDeploymentReconciler) GetDeploymentIDOrDefault() string
func (*AzureDeploymentReconciler) GetDeploymentName ¶
func (r *AzureDeploymentReconciler) GetDeploymentName() (string, bool)
func (*AzureDeploymentReconciler) GetDeploymentNameOrDefault ¶
func (r *AzureDeploymentReconciler) GetDeploymentNameOrDefault() string
func (*AzureDeploymentReconciler) GetReadyCondition ¶
func (r *AzureDeploymentReconciler) GetReadyCondition() *conditions.Condition
func (*AzureDeploymentReconciler) HasResourceSpecHashChanged ¶
func (r *AzureDeploymentReconciler) HasResourceSpecHashChanged() (bool, error)
func (*AzureDeploymentReconciler) InTerminalState ¶
func (r *AzureDeploymentReconciler) InTerminalState() bool
func (*AzureDeploymentReconciler) ManageOwnership ¶
func (*AzureDeploymentReconciler) MonitorDelete ¶
MonitorDelete will call Azure to check if the resource still exists. If so, it will requeue, else, the finalizer will be removed.
func (*AzureDeploymentReconciler) MonitorDeployment ¶
func (*AzureDeploymentReconciler) SetDeploymentID ¶
func (r *AzureDeploymentReconciler) SetDeploymentID(id string)
func (*AzureDeploymentReconciler) SetDeploymentName ¶
func (r *AzureDeploymentReconciler) SetDeploymentName(name string)
func (*AzureDeploymentReconciler) SetResourceSignature ¶
func (r *AzureDeploymentReconciler) SetResourceSignature(sig string)
func (*AzureDeploymentReconciler) SpecSignature ¶
func (r *AzureDeploymentReconciler) SpecSignature() (string, error)
SpecSignature calculates the hash of a spec. This can be used to compare specs and determine if there has been a change
func (*AzureDeploymentReconciler) StartDeleteOfResource ¶
StartDeleteOfResource will begin the delete of a resource by telling Azure to start deleting it. The resource will be marked with the provisioning state of "Deleting".
func (*AzureDeploymentReconciler) Update ¶
func (r *AzureDeploymentReconciler) Update( deployment *armclient.Deployment, status genruntime.FromARMConverter) error
func (*AzureDeploymentReconciler) UpdateBeforeCreatingDeployment ¶
func (r *AzureDeploymentReconciler) UpdateBeforeCreatingDeployment( deploymentName string, deploymentID string) error
type CreateOrUpdateAction ¶
type CreateOrUpdateAction string
type DeleteAction ¶
type DeleteAction string
type DeploymentErrorClassification ¶
type DeploymentErrorClassification string
type DeploymentErrorDetails ¶
type DeploymentErrorDetails struct { Classification DeploymentErrorClassification Code string Message string }
func ClassifyDeploymentError ¶
func ClassifyDeploymentError(deploymentError *armclient.DeploymentError) DeploymentErrorDetails
type FatalReconciliationError ¶
type FatalReconciliationError struct {
Message string
}
func AsFatalReconciliationError ¶
func AsFatalReconciliationError(e error) (FatalReconciliationError, bool)
func (FatalReconciliationError) Error ¶
func (e FatalReconciliationError) Error() string