workflow

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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"
)

General reasons

const (
	ProjectNotCreatedInAtlas                ConditionReason = "ProjectNotCreatedInAtlas"
	ProjectIPAccessInvalid                  ConditionReason = "ProjectIPAccessListInvalid"
	ProjectIPNotCreatedInAtlas              ConditionReason = "ProjectIPAccessListNotCreatedInAtlas"
	ProjectPEServiceIsNotReadyInAtlas       ConditionReason = "ProjectPrivateEndpointServiceIsNotReadyInAtlas"
	ProjectPrivateEndpointIsNotReadyInAtlas ConditionReason = "ProjectPrivateEndpointIsNotReadyInAtlas"
	ProjectIPAccessListNotActive            ConditionReason = "ProjectIPAccessListNotActive"
)

Atlas Project reasons

const (
	ClusterNotCreatedInAtlas           ConditionReason = "ClusterNotCreatedInAtlas"
	ClusterNotUpdatedInAtlas           ConditionReason = "ClusterNotUpdatedInAtlas"
	ClusterCreating                    ConditionReason = "ClusterCreating"
	ClusterUpdating                    ConditionReason = "ClusterUpdating"
	ClusterConnectionSecretsNotCreated ConditionReason = "ClusterConnectionSecretsNotCreated"
)

Atlas Cluster reasons

const (
	DatabaseUserNotCreatedInAtlas           ConditionReason = "DatabaseUserNotCreatedInAtlas"
	DatabaseUserNotUpdatedInAtlas           ConditionReason = "DatabaseUserNotUpdatedInAtlas"
	DatabaseUserConnectionSecretsNotCreated ConditionReason = "DatabaseUserConnectionSecretsNotCreated"
	DatabaseUserStaleConnectionSecrets      ConditionReason = "DatabaseUserStaleConnectionSecrets"
	DatabaseUserClustersAppliedChanges      ConditionReason = "ClustersAppliedDatabaseUsersChanges"
	DatabaseUserInvalidSpec                 ConditionReason = "DatabaseUserInvalidSpec"
	DatabaseUserExpired                     ConditionReason = "DatabaseUserExpired"
)

Atlas Database User 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) Conditions

func (c Context) Conditions() []status.Condition

func (*Context) EnsureCondition

func (c *Context) EnsureCondition(condition status.Condition) *Context

func (*Context) EnsureStatusOption

func (c *Context) EnsureStatusOption(option status.Option) *Context

func (Context) LastCondition

func (c Context) LastCondition() *status.Condition

func (Context) LastConditionWarn added in v0.6.1

func (c Context) LastConditionWarn() bool

func (*Context) SetConditionFalse

func (c *Context) SetConditionFalse(conditionType status.ConditionType) *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 (c Context) StatusOptions() []status.Option

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 OK

func OK() Result

OK indicates that the reconciliation logic can proceed further

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

func (r Result) IsOk() bool

func (Result) ReconcileResult

func (r Result) ReconcileResult() reconcile.Result

func (Result) WithRetry

func (r Result) WithRetry(retry time.Duration) Result

func (Result) WithoutRetry

func (r Result) WithoutRetry() Result

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 NewStatus

func NewStatus(conditions []status.Condition) Status

func (*Status) EnsureCondition

func (s *Status) EnsureCondition(condition status.Condition)

func (*Status) EnsureOption

func (s *Status) EnsureOption(option status.Option)

Jump to

Keyboard shortcuts

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