Documentation ¶
Index ¶
- Constants
- func ApplyLastConfigApplied(ctx context.Context, resource api.AtlasCustomResource, k8sClient client.Client) error
- func ApplyLastConfigSkipped(ctx context.Context, resource api.AtlasCustomResource, k8sClient client.Client) error
- func ComputeSecret(project *akov2.AtlasProject, resource api.ResourceWithCredentials) (*client.ObjectKey, error)
- func HaveFinalizer(resource api.AtlasCustomResource, finalizer string) bool
- func IsOwner(resource api.AtlasCustomResource, protectionFlag bool, ...) (bool, error)
- func IsResourceManagedByOperator(resource api.AtlasCustomResource) (bool, error)
- func IsResourcePolicyKeep(resource api.AtlasCustomResource) bool
- func IsResourcePolicyKeepOrDefault(resource akov2.AtlasCustomResource, protectionFlag bool) bool
- func ManageFinalizer(ctx context.Context, c client.Client, resource api.AtlasCustomResource, ...) error
- func PrepareResource(ctx context.Context, client client.Client, request reconcile.Request, ...) workflow.Result
- func ReconciliationShouldBeSkipped(resource api.AtlasCustomResource) bool
- func ResourceVersionIsValid(resource api.AtlasCustomResource) (bool, error)
- func SetAnnotation(resource api.AtlasCustomResource, key, value string)
- func SetFinalizer(resource api.AtlasCustomResource, finalizer string)
- func UnsetFinalizer(resource api.AtlasCustomResource, finalizer string)
- func ValidateResourceVersion(ctx *workflow.Context, resource api.AtlasCustomResource, ...) workflow.Result
- type AtlasChecker
- type FinalizerOperator
- type OperatorChecker
Constants ¶
View Source
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" )
View Source
const ( AnnotationLastAppliedConfiguration = "mongodb.com/last-applied-configuration" AnnotationLastSkippedConfiguration = "mongodb.com/last-skipped-configuration" )
View Source
const FinalizerLabel = "mongodbatlas/finalizer"
Variables ¶
This section is empty.
Functions ¶
func ApplyLastConfigApplied ¶
func ApplyLastConfigSkipped ¶ added in v2.6.0
func ComputeSecret ¶ added in v2.5.0
func ComputeSecret(project *akov2.AtlasProject, resource api.ResourceWithCredentials) (*client.ObjectKey, error)
func HaveFinalizer ¶
func HaveFinalizer(resource api.AtlasCustomResource, finalizer string) bool
func IsOwner ¶
func IsOwner(resource api.AtlasCustomResource, protectionFlag bool, operatorChecker OperatorChecker, atlasChecker AtlasChecker) (bool, error)
func IsResourceManagedByOperator ¶
func IsResourceManagedByOperator(resource api.AtlasCustomResource) (bool, error)
func IsResourcePolicyKeep ¶ added in v2.1.0
func IsResourcePolicyKeep(resource api.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 akov2.AtlasCustomResource, protectionFlag bool) bool
func ManageFinalizer ¶
func ManageFinalizer( ctx context.Context, c client.Client, resource api.AtlasCustomResource, op FinalizerOperator, ) error
func PrepareResource ¶
func PrepareResource(ctx context.Context, client client.Client, request reconcile.Request, resource api.AtlasCustomResource, log *zap.SugaredLogger) workflow.Result
PrepareResource queries the Custom Resource 'request.NamespacedName' and populates the 'resource' pointer.
func ReconciliationShouldBeSkipped ¶
func ReconciliationShouldBeSkipped(resource api.AtlasCustomResource) bool
ReconciliationShouldBeSkipped returns 'true' if reconciliation should be skipped for this resource.
func ResourceVersionIsValid ¶
func ResourceVersionIsValid(resource api.AtlasCustomResource) (bool, error)
ResourceVersionIsValid returns 'true' if current version of resource is <= current version of the operator.
func SetAnnotation ¶
func SetAnnotation(resource api.AtlasCustomResource, key, value string)
SetAnnotation sets an annotation in resource while respecting the rest of annotations.
func SetFinalizer ¶
func SetFinalizer(resource api.AtlasCustomResource, finalizer string)
SetFinalizer Add the given finalizer to the list of resource finalizer
func UnsetFinalizer ¶
func UnsetFinalizer(resource api.AtlasCustomResource, finalizer string)
UnsetFinalizer remove the given finalizer from the list of resource finalizer
func ValidateResourceVersion ¶
func ValidateResourceVersion(ctx *workflow.Context, resource api.AtlasCustomResource, log *zap.SugaredLogger) workflow.Result
Types ¶
type AtlasChecker ¶
type AtlasChecker func(resource api.AtlasCustomResource) (bool, error)
type FinalizerOperator ¶
type FinalizerOperator func(resource api.AtlasCustomResource, finalizer string)
type OperatorChecker ¶
type OperatorChecker func(resource api.AtlasCustomResource) (bool, error)
Click to show internal directories.
Click to hide internal directories.