customresource

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourcePolicyAnnotation       = "mongodb.com/atlas-resource-policy"
	ReconciliationPolicyAnnotation = "mongodb.com/atlas-reconciliation-policy"
	ResourceVersion                = "app.kubernetes.io/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"
)
View Source
const FinalizerLabel = "mongodbatlas/finalizer"

Variables

This section is empty.

Functions

func ApplyLastConfigApplied added in v1.8.1

func ApplyLastConfigApplied(ctx context.Context, resource mdbv1.AtlasCustomResource, k8sClient client.Client) error

func HaveFinalizer added in v1.6.0

func HaveFinalizer(resource mdbv1.AtlasCustomResource, finalizer string) bool

func IsGov added in v1.9.0

func IsGov(domain string) bool

func IsOwner added in v1.8.1

func IsOwner(resource mdbv1.AtlasCustomResource, protectionFlag bool, operatorChecker OperatorChecker, atlasChecker AtlasChecker) (bool, error)

func IsResourceManagedByOperator added in v1.8.1

func IsResourceManagedByOperator(resource mdbv1.AtlasCustomResource) (bool, error)

func IsResourceProtected added in v1.8.1

func IsResourceProtected(resource mdbv1.AtlasCustomResource, protectionFlag bool) bool

func IsResourceSupportedInDomain added in v1.9.0

func IsResourceSupportedInDomain(resource mdbv1.AtlasCustomResource, domain string) bool

func ManageFinalizer added in v1.8.1

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) *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(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 added in v0.8.0

func ReconciliationShouldBeSkipped(resource mdbv1.AtlasCustomResource) bool

ReconciliationShouldBeSkipped returns 'true' if reconciliation should be skipped for this resource.

func ResourceShouldBeLeftInAtlas added in v0.6.1

func ResourceShouldBeLeftInAtlas(resource mdbv1.AtlasCustomResource) bool

ResourceShouldBeLeftInAtlas returns 'true' if the resource should not be removed from Atlas on K8s resource removal.

func ResourceVersionIsValid added in v1.6.0

func ResourceVersionIsValid(resource mdbv1.AtlasCustomResource) (bool, error)

ResourceVersionIsValid returns 'true' if current version of resource is <= current version of the operator.

func SetAnnotation added in v1.8.1

func SetAnnotation(resource mdbv1.AtlasCustomResource, key, value string)

SetAnnotation sets an annotation in resource while respecting the rest of annotations.

func SetFinalizer added in v1.6.0

func SetFinalizer(resource mdbv1.AtlasCustomResource, finalizer string)

SetFinalizer Add the given finalizer to the list of resource finalizer

func UnsetFinalizer added in v1.6.0

func UnsetFinalizer(resource mdbv1.AtlasCustomResource, finalizer string)

UnsetFinalizer remove the given finalizer from the list of resource finalizer

func ValidateResourceVersion added in v1.6.0

func ValidateResourceVersion(ctx *workflow.Context, resource mdbv1.AtlasCustomResource, log *zap.SugaredLogger) workflow.Result

Types

type AtlasChecker added in v1.8.1

type AtlasChecker func(resource mdbv1.AtlasCustomResource) (bool, error)

type FinalizerOperator added in v1.8.1

type FinalizerOperator func(resource mdbv1.AtlasCustomResource, finalizer string)

type OperatorChecker added in v1.8.1

type OperatorChecker func(resource mdbv1.AtlasCustomResource) (bool, error)

Jump to

Keyboard shortcuts

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