Documentation ¶
Index ¶
- Constants
- type ConditionReason
- type Context
- func (c *Context) AddResourcesToWatch(resources ...watch.WatchedObject)
- func (c Context) Conditions() []status.Condition
- func (c *Context) EnsureCondition(condition status.Condition) *Context
- func (c *Context) EnsureStatusOption(option status.Option) *Context
- func (c Context) GetCondition(conditionType status.ConditionType) (condition status.Condition, found bool)
- func (c Context) LastCondition() *status.Condition
- func (c Context) LastConditionWarn() bool
- func (c *Context) ListResourcesToWatch() []watch.WatchedObject
- func (c *Context) SetConditionFalse(conditionType status.ConditionType) *Context
- func (c *Context) SetConditionFalseMsg(conditionType status.ConditionType, msg string) *Context
- func (c *Context) SetConditionFromResult(conditionType status.ConditionType, result Result) *Context
- func (c *Context) SetConditionTrue(conditionType status.ConditionType) *Context
- func (c Context) StatusOptions() []status.Option
- func (c *Context) UnsetCondition(conditionType status.ConditionType) *Context
- type Result
- func (r Result) GetMessage() string
- func (r Result) IsInProgress() bool
- func (r Result) IsOk() bool
- func (r Result) IsWarning() bool
- func (r Result) ReconcileResult() reconcile.Result
- func (r Result) WithMessage(message string) Result
- func (r Result) WithRetry(retry time.Duration) Result
- func (r Result) WithoutRetry() Result
- type Status
Constants ¶
const ( DefaultRetry = time.Second * 10 DefaultTimeout = time.Minute * 20 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConditionReason ¶
type ConditionReason string
const ( AtlasCredentialsNotProvided ConditionReason = "AtlasCredentialsNotProvided" Internal ConditionReason = "InternalError" AtlasResourceVersionMismatch ConditionReason = "AtlasResourceVersionMismatch" AtlasResourceVersionIsInvalid ConditionReason = "AtlasResourceVersionIsInvalid" AtlasFinalizerNotSet ConditionReason = "AtlasFinalizerNotSet" AtlasFinalizerNotRemoved ConditionReason = "AtlasFinalizerNotRemoved" AtlasDeletionProtection ConditionReason = "AtlasDeletionProtection" AtlasGovUnsupported ConditionReason = "AtlasGovUnsupported" )
General reasons
const ( ProjectNotCreatedInAtlas ConditionReason = "ProjectNotCreatedInAtlas" ProjectIPAccessInvalid ConditionReason = "ProjectIPAccessListInvalid" ProjectIPNotCreatedInAtlas ConditionReason = "ProjectIPAccessListNotCreatedInAtlas" ProjectWindowInvalid ConditionReason = "ProjectWindowInvalid" ProjectWindowNotObtainedFromAtlas ConditionReason = "ProjectWindowNotObtainedFromAtlas" ProjectWindowNotCreatedInAtlas ConditionReason = "ProjectWindowNotCreatedInAtlas" ProjectWindowNotDeletedInAtlas ConditionReason = "projectWindowNotDeletedInAtlas" ProjectWindowNotDeferredInAtlas ConditionReason = "ProjectWindowNotDeferredInAtlas" ProjectWindowNotAutoDeferredInAtlas ConditionReason = "ProjectWindowNotAutoDeferredInAtlas" ProjectPEServiceIsNotReadyInAtlas ConditionReason = "ProjectPrivateEndpointServiceIsNotReadyInAtlas" ProjectPEInterfaceIsNotReadyInAtlas ConditionReason = "ProjectPrivateEndpointIsNotReadyInAtlas" ProjectIPAccessListNotActive ConditionReason = "ProjectIPAccessListNotActive" ProjectIntegrationInternal ConditionReason = "ProjectIntegrationInternalError" ProjectIntegrationRequest ConditionReason = "ProjectIntegrationRequestError" ProjectIntegrationReady ConditionReason = "ProjectIntegrationReady" ProjectPrivateEndpointIsNotReadyInAtlas ConditionReason = "ProjectPrivateEndpointIsNotReadyInAtlas" ProjectNetworkPeerIsNotReadyInAtlas ConditionReason = "ProjectNetworkPeerIsNotReadyInAtlas" ProjectEncryptionAtRestReady ConditionReason = "ProjectEncryptionAtRestReady" ProjectCloudAccessRolesIsNotReadyInAtlas ConditionReason = "ProjectCloudAccessRolesIsNotReadyInAtlas" ProjectAuditingReady ConditionReason = "ProjectAuditingReady" ProjectSettingsReady ConditionReason = "ProjectSettingsReady" ProjectAlertConfigurationIsNotReadyInAtlas ConditionReason = "ProjectAlertConfigurationIsNotReadyInAtlas" ProjectCustomRolesReady ConditionReason = "ProjectCustomRolesReady" )
Atlas Project reasons
const ( DeploymentNotCreatedInAtlas ConditionReason = "DeploymentNotCreatedInAtlas" DeploymentNotUpdatedInAtlas ConditionReason = "DeploymentNotUpdatedInAtlas" DeploymentCreating ConditionReason = "DeploymentCreating" DeploymentUpdating ConditionReason = "DeploymentUpdating" DeploymentConnectionSecretsNotCreated ConditionReason = "DeploymentConnectionSecretsNotCreated" DeploymentAdvancedOptionsReady ConditionReason = "DeploymentAdvancedOptionsReady" ServerlessPrivateEndpointReady ConditionReason = "ServerlessPrivateEndpointReady" ManagedNamespacesReady ConditionReason = "ManagedNamespacesReady" CustomZoneMappingReady ConditionReason = "CustomZoneMappingReady" )
Atlas Deployment reasons
const ( DatabaseUserNotCreatedInAtlas ConditionReason = "DatabaseUserNotCreatedInAtlas" DatabaseUserNotUpdatedInAtlas ConditionReason = "DatabaseUserNotUpdatedInAtlas" DatabaseUserNotDeletedInAtlas ConditionReason = "DatabaseUserNotDeletedInAtlas" DatabaseUserConnectionSecretsNotCreated ConditionReason = "DatabaseUserConnectionSecretsNotCreated" DatabaseUserConnectionSecretsNotDeleted ConditionReason = "DatabaseUserConnectionSecretsNotDeleted" DatabaseUserStaleConnectionSecrets ConditionReason = "DatabaseUserStaleConnectionSecrets" DatabaseUserDeploymentAppliedChanges ConditionReason = "DeploymentAppliedDatabaseUsersChanges" DatabaseUserInvalidSpec ConditionReason = "DatabaseUserInvalidSpec" DatabaseUserExpired ConditionReason = "DatabaseUserExpired" )
Atlas Database User reasons
const ( DataFederationNotCreatedInAtlas ConditionReason = "DataFederationNotCreatedInAtlas" DataFederationNotUpdatedInAtlas ConditionReason = "DataFederationNotUpdatedInAtlas" DataFederationCreating ConditionReason = "DataFederationCreating" DataFederationUpdating ConditionReason = "DataFederationUpdating" )
Atlas Data Federation reasons
const ( TeamNotCreatedInAtlas ConditionReason = "TeamNotCreatedInAtlas" TeamNotUpdatedInAtlas ConditionReason = "TeamNotUpdatedInAtlas" TeamInvalidSpec ConditionReason = "TeamInvalidSpec" TeamUsersNotReady ConditionReason = "TeamUsersNotReady" TeamDoesNotExist ConditionReason = "TeamDoesNotExist" )
Atlas Teams reasons
const ( FederatedAuthNotAvailable ConditionReason = "FederatedAuthNotAvailable" FederatedAuthIsNotEnabledInCR ConditionReason = "FederatedAuthNotEnabledInCR" FederatedAuthOrgNotConnected ConditionReason = "FederatedAuthOrgIsNotConnected" FederatedAuthUsersConflict ConditionReason = "FederatedAuthUsersConflict" )
Atlas Federated Auth reasons
type Context ¶
type Context struct { // Log is the root logger used in the reconciliation. Used just for convenience to avoid passing log to each // method. // Is not supposed to be mutated! Log *zap.SugaredLogger // Client is a mongodb atlas client used to make v1.0 API calls Client mongodbatlas.Client // Connection is an object encapsulating information about connecting to Atlas using API Connection atlas.Connection // contains filtered or unexported fields }
Context is a container for some information that is needed on all levels of function calls during reconciliation. It's mutable by design. Note, that it's completely different from the Go Context
func NewContext ¶
func NewContext(log *zap.SugaredLogger, conditions []status.Condition) *Context
func (*Context) AddResourcesToWatch ¶ added in v1.8.1
func (c *Context) AddResourcesToWatch(resources ...watch.WatchedObject)
func (Context) Conditions ¶
func (*Context) EnsureCondition ¶
func (*Context) EnsureStatusOption ¶
func (Context) GetCondition ¶ added in v1.1.0
func (Context) LastCondition ¶
func (Context) LastConditionWarn ¶ added in v0.6.1
func (*Context) ListResourcesToWatch ¶ added in v1.8.1
func (c *Context) ListResourcesToWatch() []watch.WatchedObject
func (*Context) SetConditionFalse ¶
func (c *Context) SetConditionFalse(conditionType status.ConditionType) *Context
func (*Context) SetConditionFalseMsg ¶ added in v1.8.0
func (c *Context) SetConditionFalseMsg(conditionType status.ConditionType, msg string) *Context
func (*Context) SetConditionFromResult ¶
func (c *Context) SetConditionFromResult(conditionType status.ConditionType, result Result) *Context
func (*Context) SetConditionTrue ¶
func (c *Context) SetConditionTrue(conditionType status.ConditionType) *Context
func (Context) StatusOptions ¶
func (*Context) UnsetCondition ¶ added in v1.1.0
func (c *Context) UnsetCondition(conditionType status.ConditionType) *Context
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func InProgress ¶
func InProgress(reason ConditionReason, message string) Result
InProgress indicates that the reconciliation logic cannot proceed and needs to be finished (and possibly requeued). This is an expected termination of the reconciliation process so 'warning' flag is set to 'false'. 'reason' and 'message' indicate the in-progress state and are supposed to be reflected in the 'conditions' for the reconciled Custom Resource.
func Terminate ¶
func Terminate(reason ConditionReason, message string) Result
Terminate indicates that the reconciliation logic cannot proceed and needs to be finished (and possibly requeued). This is not an expected termination of the reconciliation process so 'warning' flag is set to 'true'. 'reason' and 'message' indicate the error state and are supposed to be reflected in the `conditions` for the reconciled Custom Resource.
func TerminateSilently ¶
func TerminateSilently() Result
TerminateSilently indicates that the reconciliation logic cannot proceed and needs to be finished (and possibly requeued) The status of the reconciled Custom Resource is not supposed to be updated.
func (Result) GetMessage ¶ added in v1.0.0
func (Result) IsInProgress ¶ added in v1.9.0
func (Result) ReconcileResult ¶
func (Result) WithMessage ¶ added in v1.1.0
func (Result) WithoutRetry ¶
WithoutRetry indicates that no retry must happen after the reconciliation is over. This should usually be used in cases when retry won't fix the situation like when the spec is incorrect and requires the user to update it.
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status is a mutable container containing the status of some particular reconciliation. It is expected to be updated by a controller and at any time it reflects the status of the reconciled resource. Its state should fully match the state of the resource so the information could be used to update the status field of the Custom Resource.
func (*Status) EnsureCondition ¶
func (*Status) EnsureOption ¶
func (*Status) GetCondition ¶ added in v1.1.0
func (*Status) RemoveCondition ¶ added in v1.1.0
func (s *Status) RemoveCondition(conditionType status.ConditionType)