operator

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultClustersCount = 10
	InactiveStatus       = "INACTIVE"
)

Variables

View Source
var (
	ErrServerless             = errors.New("serverless instance error")
	ErrNoCloudManagerClusters = errors.New("can not get 'advanced clusters' object")
)

Functions

This section is empty.

Types

type ConfigApply

type ConfigApply struct {
	OrgID        string
	ProjectID    string
	ClusterNames []string

	Namespace string
	Version   string
	// contains filtered or unexported fields
}

func NewConfigApply

func NewConfigApply(params NewConfigApplyParams) *ConfigApply

func (*ConfigApply) Run

func (apply *ConfigApply) Run() error

func (*ConfigApply) WithNamespace

func (apply *ConfigApply) WithNamespace(namespace string) *ConfigApply

func (*ConfigApply) WithTargetOperatorVersion

func (apply *ConfigApply) WithTargetOperatorVersion(version string) *ConfigApply

type ConfigExporter

type ConfigExporter struct {
	// contains filtered or unexported fields
}

func NewConfigExporter

func NewConfigExporter(dataProvider store.OperatorGenericStore, credsProvider store.CredentialsGetter, projectID, orgID string) *ConfigExporter

func (*ConfigExporter) Run

func (e *ConfigExporter) Run() (string, error)

func (*ConfigExporter) WithClustersNames

func (e *ConfigExporter) WithClustersNames(clusters []string) *ConfigExporter

func (*ConfigExporter) WithDataFederationNames

func (e *ConfigExporter) WithDataFederationNames(dataFederations []string) *ConfigExporter

func (*ConfigExporter) WithFeatureValidator

func (e *ConfigExporter) WithFeatureValidator(validator features.FeatureValidator) *ConfigExporter

func (*ConfigExporter) WithIndependentResources

func (e *ConfigExporter) WithIndependentResources(enabled bool) *ConfigExporter

func (*ConfigExporter) WithPatcher

func (e *ConfigExporter) WithPatcher(p Patcher) *ConfigExporter

func (*ConfigExporter) WithSecretsData

func (e *ConfigExporter) WithSecretsData(enabled bool) *ConfigExporter

func (*ConfigExporter) WithTargetNamespace

func (e *ConfigExporter) WithTargetNamespace(namespace string) *ConfigExporter

func (*ConfigExporter) WithTargetOperatorVersion

func (e *ConfigExporter) WithTargetOperatorVersion(version string) *ConfigExporter

type Exporter added in v1.2.5

type Exporter interface {
	// Run executes the export process and returns the serialized Kubernetes manifests
	// as a YAML string, or an error if the export fails.
	Run() (string, error)
}

Exporter defines the interface for exporting Atlas resources to Kubernetes manifests. This interface allows switching between different exporter implementations based on the CRD version (curated vs generated).

type GeneratedExporter added in v1.2.5

type GeneratedExporter struct {
	// contains filtered or unexported fields
}

GeneratedExporter handles the export of Atlas resources using auto-generated CRDs. It leverages the Crapi library for bi-directional translation between Go types representing CRDs and the corresponding Go types within the Atlas SDK.

func NewGeneratedExporter added in v1.2.5

func NewGeneratedExporter(cfg GeneratedExporterConfig) *GeneratedExporter

NewGeneratedExporter creates a new instance of GeneratedExporter.

func (*GeneratedExporter) Run added in v1.2.5

func (e *GeneratedExporter) Run() (string, error)

Run executes the generated resource export workflow. It retrieves resources from MongoDB Atlas using the SDK, delegates type conversion to the Crapi translator, and serializes the CRD objects to YAML format.

func (*GeneratedExporter) ShouldIncludeSecrets added in v1.2.5

func (e *GeneratedExporter) ShouldIncludeSecrets() bool

ShouldIncludeSecrets returns true if secrets should be generated and referenced. Secrets are included when explicitly requested (includeSecrets=true) or when resources are independent (independentResources=true) to ensure they work standalone.

type GeneratedExporterConfig added in v1.2.5

type GeneratedExporterConfig struct {
	TargetNamespace      string
	Scheme               *runtime.Scheme
	Exporters            []generated.Exporter
	IndependentResources bool
	IncludeSecrets       bool
	CredentialsProvider  store.CredentialsGetter
	OrgID                string
}

GeneratedExporterConfig holds the configuration for creating a GeneratedExporter.

type Install

type Install struct {
	// contains filtered or unexported fields
}

func NewInstall

func NewInstall(
	installer Installer,
	atlasStore store.OperatorGenericStore,
	credStore store.CredentialsGetter,
	featureValidator features.FeatureValidator,
	kubectl *kubernetes.KubeCtl,
	version string,
	ipAccessList string,
) *Install

func (*Install) Run

func (i *Install) Run(ctx context.Context, orgID string) error

func (*Install) WithAtlasGov

func (i *Install) WithAtlasGov(flag bool) *Install

func (*Install) WithConfigOnly added in v1.1.0

func (i *Install) WithConfigOnly(configOnly bool) *Install

func (*Install) WithImportResources

func (i *Install) WithImportResources(flag bool) *Install

func (*Install) WithNamespace

func (i *Install) WithNamespace(namespace string) *Install

func (*Install) WithResourceDeletionProtection

func (i *Install) WithResourceDeletionProtection(flag bool) *Install

func (*Install) WithSubResourceDeletionProtection

func (i *Install) WithSubResourceDeletionProtection(flag bool) *Install

func (*Install) WithWatchNamespaces

func (i *Install) WithWatchNamespaces(namespaces []string) *Install

func (*Install) WithWatchProjectName

func (i *Install) WithWatchProjectName(name string) *Install

type InstallConfig

type InstallConfig struct {
	Version                              string
	Namespace                            string
	Watch                                []string
	ResourceDeletionProtectionEnabled    bool
	SubResourceDeletionProtectionEnabled bool
	AtlasGov                             bool
	ConfigOnly                           bool
}

type InstallResources

type InstallResources struct {
	// contains filtered or unexported fields
}

func NewInstaller

func NewInstaller(versionProvider version.AtlasOperatorVersionProvider, kubectl *kubernetes.KubeCtl, deletionProtection, subDeletionProtection bool) *InstallResources

func (*InstallResources) InstallCRDs

func (ir *InstallResources) InstallCRDs(ctx context.Context, v string, namespaced bool) error

func (*InstallResources) InstallConfiguration

func (ir *InstallResources) InstallConfiguration(ctx context.Context, installConfig *InstallConfig) error

func (*InstallResources) InstallCredentials

func (ir *InstallResources) InstallCredentials(ctx context.Context, namespace, orgID, publicKey, privateKey string, projectName string) error

type Installer

type Installer interface {
	InstallCRDs(ctx context.Context, v string, namespaced bool) error
	InstallConfiguration(ctx context.Context, installConfig *InstallConfig) error
	InstallCredentials(ctx context.Context, namespace, orgID, publicKey, privateKey string, projectName string) error
}

type NewConfigApplyParams

type NewConfigApplyParams struct {
	OrgID     string
	ProjectID string

	KubeCtl  *kubernetes.KubeCtl
	Exporter *ConfigExporter
}

type Patcher

type Patcher interface {
	Patch(obj runtime.Object) error
}

Jump to

Keyboard shortcuts

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