Documentation
¶
Index ¶
- Constants
- Variables
- type ConfigApply
- type ConfigExporter
- func (e *ConfigExporter) Run() (string, error)
- func (e *ConfigExporter) WithClustersNames(clusters []string) *ConfigExporter
- func (e *ConfigExporter) WithDataFederationNames(dataFederations []string) *ConfigExporter
- func (e *ConfigExporter) WithFeatureValidator(validator features.FeatureValidator) *ConfigExporter
- func (e *ConfigExporter) WithIndependentResources(enabled bool) *ConfigExporter
- func (e *ConfigExporter) WithPatcher(p Patcher) *ConfigExporter
- func (e *ConfigExporter) WithSecretsData(enabled bool) *ConfigExporter
- func (e *ConfigExporter) WithTargetNamespace(namespace string) *ConfigExporter
- func (e *ConfigExporter) WithTargetOperatorVersion(version string) *ConfigExporter
- type Exporter
- type GeneratedExporter
- type GeneratedExporterConfig
- type Install
- func (i *Install) Run(ctx context.Context, orgID string) error
- func (i *Install) WithAtlasGov(flag bool) *Install
- func (i *Install) WithConfigOnly(configOnly bool) *Install
- func (i *Install) WithImportResources(flag bool) *Install
- func (i *Install) WithNamespace(namespace string) *Install
- func (i *Install) WithResourceDeletionProtection(flag bool) *Install
- func (i *Install) WithSubResourceDeletionProtection(flag bool) *Install
- func (i *Install) WithWatchNamespaces(namespaces []string) *Install
- func (i *Install) WithWatchProjectName(name string) *Install
- type InstallConfig
- type InstallResources
- func (ir *InstallResources) InstallCRDs(ctx context.Context, v string, namespaced bool) error
- func (ir *InstallResources) InstallConfiguration(ctx context.Context, installConfig *InstallConfig) error
- func (ir *InstallResources) InstallCredentials(ctx context.Context, namespace, orgID, publicKey, privateKey string, ...) error
- type Installer
- type NewConfigApplyParams
- type Patcher
Constants ¶
const ( DefaultClustersCount = 10 InactiveStatus = "INACTIVE" )
Variables ¶
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) WithAtlasGov ¶
func (*Install) WithConfigOnly ¶ added in v1.1.0
func (*Install) WithImportResources ¶
func (*Install) WithNamespace ¶
func (*Install) WithResourceDeletionProtection ¶
func (*Install) WithSubResourceDeletionProtection ¶
func (*Install) WithWatchNamespaces ¶
func (*Install) WithWatchProjectName ¶
type InstallConfig ¶
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 (*InstallResources) InstallConfiguration ¶
func (ir *InstallResources) InstallConfiguration(ctx context.Context, installConfig *InstallConfig) error
func (*InstallResources) InstallCredentials ¶
type NewConfigApplyParams ¶
type NewConfigApplyParams struct {
OrgID string
ProjectID string
KubeCtl *kubernetes.KubeCtl
Exporter *ConfigExporter
}