Documentation
¶
Index ¶
- Constants
- func AutomaticDevDBSpec(drv dbv1alpha1.Driver, schemaBound bool) (*corev1.PodSpec, string, error)
- type AtlasExec
- type AtlasExecFn
- type AtlasMigrationReconciler
- func (r *AtlasMigrationReconciler) AllowCustomConfig()
- func (r *AtlasMigrationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, err error)
- func (r *AtlasMigrationReconciler) SetAtlasClient(fn AtlasExecFn)
- func (r *AtlasMigrationReconciler) SetupWithManager(mgr ctrl.Manager) error
- type AtlasSchemaReconciler
- type Cloud
- type Manager
- type ProtectedFlowError
Constants ¶
const ( StatePending = "PENDING_USER" StateApproved = "APPROVED" StateAborted = "ABORTED" StateApplied = "APPLIED" )
const ( ReasonCreatedDevDB = "CreatedDevDB" ReasonCleanUpDevDB = "CleanUpDevDB" ReasonScaledUpDevDB = "ScaledUpDevDB" )
Variables ¶
This section is empty.
Functions ¶
func AutomaticDevDBSpec ¶ added in v0.7.18
AutomaticDevDBSpec returns a PodSpec for a development database based on the target URL.
Types ¶
type AtlasExec ¶
type AtlasExec interface {
// MigrateApplySlice runs the `migrate apply` command and returns the successful runs.
MigrateApplySlice(context.Context, *atlasexec.MigrateApplyParams) ([]*atlasexec.MigrateApply, error)
// MigrateDown runs the `migrate down` command.
MigrateDown(context.Context, *atlasexec.MigrateDownParams) (*atlasexec.MigrateDown, error)
// MigrateStatus runs the `migrate status` command.
MigrateStatus(context.Context, *atlasexec.MigrateStatusParams) (*atlasexec.MigrateStatus, error)
// SchemaApplySlice runs the `schema apply` command and returns the successful runs.
SchemaApplySlice(context.Context, *atlasexec.SchemaApplyParams) ([]*atlasexec.SchemaApply, error)
// SchemaInspect runs the `schema inspect` command.
SchemaInspect(ctx context.Context, params *atlasexec.SchemaInspectParams) (string, error)
// SchemaPush runs the `schema push` command.
SchemaPush(context.Context, *atlasexec.SchemaPushParams) (*atlasexec.SchemaPush, error)
// SchemaPlan runs the `schema plan` command.
SchemaPlan(context.Context, *atlasexec.SchemaPlanParams) (*atlasexec.SchemaPlan, error)
// SchemaPlanList runs the `schema plan list` command.
SchemaPlanList(context.Context, *atlasexec.SchemaPlanListParams) ([]atlasexec.SchemaPlanFile, error)
// WhoAmI runs the `whoami` command.
WhoAmI(context.Context, *atlasexec.WhoAmIParams) (*atlasexec.WhoAmI, error)
// Login runs the `login` command (e.g. with --grant-only for offline tokens).
Login(context.Context, *atlasexec.LoginParams) error
// SetStdout specifies a writer to stream stdout to for every command.
SetStdout(io.Writer)
// SetStderr specifies a writer to stream stderr to for every command.
SetStderr(io.Writer)
}
AtlasExec is the interface for the atlas exec client.
func NewAtlasExec ¶
NewAtlasExec returns a new AtlasExec with the given directory and cloud configuration. The atlas binary is expected to be in the $PATH. If DATA_DIR is set, it creates a resource-specific directory and sets HOME to it, allowing Atlas CLI to store its data (.atlas) under the mounted PVC.
type AtlasExecFn ¶
AtlasExecFn is a function that returns an AtlasExec configured with the given working directory, cloud configuration, and HOME directory.
type AtlasMigrationReconciler ¶
AtlasMigrationReconciler reconciles a AtlasMigration object
func NewAtlasMigrationReconciler ¶
func NewAtlasMigrationReconciler(mgr Manager, prewarmDevDB bool) *AtlasMigrationReconciler
func (*AtlasMigrationReconciler) AllowCustomConfig ¶ added in v0.7.0
func (r *AtlasMigrationReconciler) AllowCustomConfig()
AllowCustomConfig allows the controller to use custom atlas.hcl config.
func (*AtlasMigrationReconciler) Reconcile ¶
func (r *AtlasMigrationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, err error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*AtlasMigrationReconciler) SetAtlasClient ¶ added in v0.7.0
func (r *AtlasMigrationReconciler) SetAtlasClient(fn AtlasExecFn)
SetAtlasClient sets the Atlas client for the reconciler.
func (*AtlasMigrationReconciler) SetupWithManager ¶
func (r *AtlasMigrationReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type AtlasSchemaReconciler ¶
AtlasSchemaReconciler reconciles a AtlasSchema object
func NewAtlasSchemaReconciler ¶
func NewAtlasSchemaReconciler(mgr Manager, prewarmDevDB bool) *AtlasSchemaReconciler
func (*AtlasSchemaReconciler) AllowCustomConfig ¶ added in v0.7.0
func (r *AtlasSchemaReconciler) AllowCustomConfig()
AllowCustomConfig allows the controller to use custom atlas.hcl config.
func (*AtlasSchemaReconciler) Reconcile ¶
func (r *AtlasSchemaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, err error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*AtlasSchemaReconciler) SetAtlasClient ¶ added in v0.7.0
func (r *AtlasSchemaReconciler) SetAtlasClient(fn AtlasExecFn)
SetAtlasClient sets the Atlas client function.
func (*AtlasSchemaReconciler) SetupWithManager ¶
func (r *AtlasSchemaReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type ProtectedFlowError ¶
type ProtectedFlowError struct {
// contains filtered or unexported fields
}
func (*ProtectedFlowError) Error ¶
func (e *ProtectedFlowError) Error() string
Error implements the error interface
func (*ProtectedFlowError) Reason ¶
func (e *ProtectedFlowError) Reason() string
Reason returns the reason of the error