api

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SearchIndexesNamesAreNotUnique = "SearchIndexesNamesAreNotUnique"
	SearchIndexesNotReady          = "SearchIndexesNotReady"
)

Variables

This section is empty.

Functions

func HasConditionType

func HasConditionType(typ ConditionType, source []Condition) bool

Types

type AtlasCustomResource

type AtlasCustomResource interface {
	metav1.Object
	runtime.Object
	Reader
	Writer
}

AtlasCustomResource is the interface common for all Atlas entities

type Common

type Common struct {
	// Conditions is the list of statuses showing the current state of the Atlas Custom Resource
	Conditions []Condition `json:"conditions"`

	// ObservedGeneration indicates the generation of the resource specification that the Atlas Operator is aware of.
	// The Atlas Operator updates this field to the 'metadata.generation' as soon as it starts reconciliation of the resource.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

Common is the struct shared by all statuses in existing Custom Resources.

func (*Common) DeepCopy

func (in *Common) DeepCopy() *Common

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Common.

func (*Common) DeepCopyInto

func (in *Common) DeepCopyInto(out *Common)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Common) GetConditions

func (c Common) GetConditions() []Condition

func (Common) GetObservedGeneration

func (c Common) GetObservedGeneration() int64

type Condition

type Condition struct {
	// Type of Atlas Custom Resource condition.
	Type ConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// Last time the condition transitioned from one status to another.
	// +optional
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// The reason for the condition's last transition.
	// +optional
	Reason string `json:"reason,omitempty"`
	// A human readable message indicating details about the transition.
	// +optional
	Message string `json:"message,omitempty"`
}

Condition describes the state of an Atlas Custom Resource at a certain point.

func EnsureConditionExists

func EnsureConditionExists(condition Condition, source []Condition) []Condition

EnsureConditionExists adds or updates the condition in the copy of a 'source' slice

func FalseCondition

func FalseCondition(conditionType ConditionType) Condition

FalseCondition returns the Condition that has the 'Status' set to 'false' and 'Type' to 'conditionType'. The reason and message can be provided optionally

func InitCondition

func InitCondition(resource AtlasCustomResource, defaultCondition Condition) []Condition

InitCondition initializes the underlying type of the given condition to the given default value if the underlying condition type is unset.

func RemoveConditionIfExists

func RemoveConditionIfExists(conditionType ConditionType, source []Condition) []Condition

func TrueCondition

func TrueCondition(conditionType ConditionType) Condition

TrueCondition returns the Condition that has the 'Status' set to 'true' and 'Type' to 'conditionType'. It explicitly omits the 'Reason' and 'Message' fields.

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Condition) WithMessageRegexp

func (c Condition) WithMessageRegexp(msg string) Condition

func (Condition) WithReason

func (c Condition) WithReason(reason string) Condition

type ConditionType

type ConditionType string
const (
	ReadyType           ConditionType = "Ready"
	ValidationSucceeded ConditionType = "ValidationSucceeded"
)
const (
	ProjectReadyType                  ConditionType = "ProjectReady"
	IPAccessListReadyType             ConditionType = "IPAccessListReady"
	MaintenanceWindowReadyType        ConditionType = "MaintenanceWindowReady"
	PrivateEndpointServiceReadyType   ConditionType = "PrivateEndpointServiceReady"
	PrivateEndpointReadyType          ConditionType = "PrivateEndpointReady"
	NetworkPeerReadyType              ConditionType = "NetworkPeerReady"
	CloudProviderIntegrationReadyType ConditionType = "CloudProviderIntegrationReady"
	IntegrationReadyType              ConditionType = "ThirdPartyIntegrationReady"
	AlertConfigurationReadyType       ConditionType = "AlertConfigurationReady"
	EncryptionAtRestReadyType         ConditionType = "EncryptionAtRestReady"
	AuditingReadyType                 ConditionType = "AuditingReady"
	ProjectSettingsReadyType          ConditionType = "ProjectSettingsReady"
	ProjectCustomRolesReadyType       ConditionType = "ProjectCustomRolesReady"
	ProjectTeamsReadyType             ConditionType = "ProjectTeamsReady"
	SearchIndexesReadyType            ConditionType = "AtlasSearchIndexesReady"
	BackupComplianceReadyType         ConditionType = "BackupCompliancePolicyReady"
)

AtlasProject condition types

const (
	DeploymentReadyType                ConditionType = "DeploymentReady"
	ServerlessPrivateEndpointReadyType ConditionType = "ServerlessPrivateEndpointReady"
	ManagedNamespacesReadyType         ConditionType = "ManagedNamespacesReady"
	CustomZoneMappingReadyType         ConditionType = "CustomZoneMappingReady"
	SearchNodesReadyType               ConditionType = "SearchNodesReady"
)

AtlasDeployment condition types

const (
	DataFederationReadyType   ConditionType = "DataFederationReady"
	DataFederationPEReadyType ConditionType = "DataFederationPrivateEndpointsReady"
)

Atlas Data Federation condition types

const (
	FederatedAuthReadyType      ConditionType = "FederatedAuthReady"
	FederatedAuthRolesReadyType ConditionType = "RolesReady"
)

Atlas Federated Auth condition types

const (
	StreamInstanceReadyType   ConditionType = "StreamInstanceReady"
	StreamConnectionReadyType ConditionType = "StreamConnectionReady"
)

Atlas Streams condition types

const (
	DatabaseUserReadyType ConditionType = "DatabaseUserReady"
)

AtlasDatabaseUser condition types

const (
	ResourceVersionStatus ConditionType = "ResourceVersionIsValid"
)

Generic condition type

type Option

type Option interface{}

Option is the function that is applied to the status field of an Atlas Custom Resource. This is the way to handle some random data that need to be written to status.

type Reader

type Reader interface {
	// GetStatus returns the status of the object.
	GetStatus() Status
}

type Status

type Status interface {
	GetConditions() []Condition

	GetObservedGeneration() int64
}

Status is a generic status for any Custom Resource managed by Atlas Operator

type Writer

type Writer interface {
	// UpdateStatus allows to do the update of the status of an Atlas Custom resource.
	UpdateStatus(conditions []Condition, option ...Option)
}

Directories

Path Synopsis
v1
Package v1 contains API Schema definitions for the mongodb.com v1 API group +kubebuilder:object:generate=true +groupName=mongodb.com
Package v1 contains API Schema definitions for the mongodb.com v1 API group +kubebuilder:object:generate=true +groupName=mongodb.com

Jump to

Keyboard shortcuts

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