Documentation
¶
Index ¶
- Constants
- func ApplyLastConfigApplied(ctx context.Context, resource mdbv1.AtlasCustomResource, ...) error
- func HaveFinalizer(resource mdbv1.AtlasCustomResource, finalizer string) bool
- func IsOwner(resource mdbv1.AtlasCustomResource, protectionFlag bool, ...) (bool, error)
- func IsResourceManagedByOperator(resource mdbv1.AtlasCustomResource) (bool, error)
- func IsResourcePolicyKeep(resource mdbv1.AtlasCustomResource) bool
- func IsResourcePolicyKeepOrDefault(resource mdbv1.AtlasCustomResource, protectionFlag bool) bool
- func ManageFinalizer(ctx context.Context, client client.Client, resource mdbv1.AtlasCustomResource, ...) error
- func MarkReconciliationStarted(client client.Client, resource mdbv1.AtlasCustomResource, ...) *workflow.Context
- func PrepareResource(ctx context.Context, client client.Client, request reconcile.Request, ...) workflow.Result
- func ReconciliationShouldBeSkipped(resource mdbv1.AtlasCustomResource) bool
- func ResourceVersionIsValid(resource mdbv1.AtlasCustomResource) (bool, error)
- func SetAnnotation(resource mdbv1.AtlasCustomResource, key, value string)
- func SetFinalizer(resource mdbv1.AtlasCustomResource, finalizer string)
- func UnsetFinalizer(resource mdbv1.AtlasCustomResource, finalizer string)
- func ValidateResourceVersion(ctx *workflow.Context, resource mdbv1.AtlasCustomResource, ...) workflow.Result
- type AtlasChecker
- type FinalizerOperator
- type OperatorChecker
Constants ¶
const ( ResourcePolicyAnnotation = "mongodb.com/atlas-resource-policy" ReconciliationPolicyAnnotation = "mongodb.com/atlas-reconciliation-policy" ResourceVersion = "mongodb.com/atlas-resource-version" ResourceVersionOverride = "mongodb.com/atlas-resource-version-policy" ResourcePolicyKeep = "keep" ResourcePolicyDelete = "delete" ReconciliationPolicySkip = "skip" ResourceVersionAllow = "allow" )
const (
AnnotationLastAppliedConfiguration = "mongodb.com/last-applied-configuration"
)
const FinalizerLabel = "mongodbatlas/finalizer"
Variables ¶
This section is empty.
Functions ¶
func ApplyLastConfigApplied ¶
func HaveFinalizer ¶
func HaveFinalizer(resource mdbv1.AtlasCustomResource, finalizer string) bool
func IsOwner ¶
func IsOwner(resource mdbv1.AtlasCustomResource, protectionFlag bool, operatorChecker OperatorChecker, atlasChecker AtlasChecker) (bool, error)
func IsResourceManagedByOperator ¶
func IsResourceManagedByOperator(resource mdbv1.AtlasCustomResource) (bool, error)
func IsResourcePolicyKeep ¶ added in v2.1.0
func IsResourcePolicyKeep(resource mdbv1.AtlasCustomResource) bool
IsResourcePolicyKeep returns 'true' if the resource should not be removed from Atlas on K8s resource removal.
func IsResourcePolicyKeepOrDefault ¶ added in v2.1.0
func IsResourcePolicyKeepOrDefault(resource mdbv1.AtlasCustomResource, protectionFlag bool) bool
func ManageFinalizer ¶
func ManageFinalizer( ctx context.Context, client client.Client, resource mdbv1.AtlasCustomResource, op FinalizerOperator, ) error
func MarkReconciliationStarted ¶
func MarkReconciliationStarted(client client.Client, resource mdbv1.AtlasCustomResource, log *zap.SugaredLogger, context context.Context) *workflow.Context
MarkReconciliationStarted updates the status of the Atlas Resource to indicate that the Operator has started working on it. Internally this will also update the 'observedGeneration' field that notify clients that the resource is being worked on
func PrepareResource ¶
func PrepareResource(ctx context.Context, client client.Client, request reconcile.Request, resource mdbv1.AtlasCustomResource, log *zap.SugaredLogger) workflow.Result
PrepareResource queries the Custom Resource 'request.NamespacedName' and populates the 'resource' pointer.
func ReconciliationShouldBeSkipped ¶
func ReconciliationShouldBeSkipped(resource mdbv1.AtlasCustomResource) bool
ReconciliationShouldBeSkipped returns 'true' if reconciliation should be skipped for this resource.
func ResourceVersionIsValid ¶
func ResourceVersionIsValid(resource mdbv1.AtlasCustomResource) (bool, error)
ResourceVersionIsValid returns 'true' if current version of resource is <= current version of the operator.
func SetAnnotation ¶
func SetAnnotation(resource mdbv1.AtlasCustomResource, key, value string)
SetAnnotation sets an annotation in resource while respecting the rest of annotations.
func SetFinalizer ¶
func SetFinalizer(resource mdbv1.AtlasCustomResource, finalizer string)
SetFinalizer Add the given finalizer to the list of resource finalizer
func UnsetFinalizer ¶
func UnsetFinalizer(resource mdbv1.AtlasCustomResource, finalizer string)
UnsetFinalizer remove the given finalizer from the list of resource finalizer
func ValidateResourceVersion ¶
func ValidateResourceVersion(ctx *workflow.Context, resource mdbv1.AtlasCustomResource, log *zap.SugaredLogger) workflow.Result
Types ¶
type AtlasChecker ¶
type AtlasChecker func(resource mdbv1.AtlasCustomResource) (bool, error)
type FinalizerOperator ¶
type FinalizerOperator func(resource mdbv1.AtlasCustomResource, finalizer string)
type OperatorChecker ¶
type OperatorChecker func(resource mdbv1.AtlasCustomResource) (bool, error)