controller

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatePending  = "PENDING_USER"
	StateApproved = "APPROVED"
	StateAborted  = "ABORTED"
	StateApplied  = "APPLIED"
)
View Source
const (
	ReasonCreatedDevDB  = "CreatedDevDB"
	ReasonCleanUpDevDB  = "CleanUpDevDB"
	ReasonScaledUpDevDB = "ScaledUpDevDB"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AtlasExec

type AtlasExec interface {
	// MigrateApply runs the `migrate apply` command and returns the successful runs.
	MigrateApply(context.Context, *atlasexec.MigrateApplyParams) (*atlasexec.MigrateApply, error)
	// MigrateDown runs the `migrate down` command.
	MigrateDown(context.Context, *atlasexec.MigrateDownParams) (*atlasexec.MigrateDown, error)
	// MigrateLint runs the `migrate lint` command.
	MigrateLint(context.Context, *atlasexec.MigrateLintParams) (*atlasexec.SummaryReport, error)
	// MigrateStatus runs the `migrate status` command.
	MigrateStatus(context.Context, *atlasexec.MigrateStatusParams) (*atlasexec.MigrateStatus, error)

	// SchemaApply runs the `schema apply` command.
	SchemaApply(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(ctx context.Context) (*atlasexec.WhoAmI, error)
}

AtlasExec is the interface for the atlas exec client.

func NewAtlasExec

func NewAtlasExec(dir string, c *Cloud) (AtlasExec, error)

NewAtlasExec returns a new AtlasExec with the given directory and cloud configuration. The atlas binary is expected to be in the $PATH.

type AtlasExecFn

type AtlasExecFn func(string, *Cloud) (AtlasExec, error)

AtlasExecFn is a function that returns an AtlasExec with the working directory.

type AtlasMigrationReconciler

type AtlasMigrationReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

AtlasMigrationReconciler reconciles a AtlasMigration object

func NewAtlasMigrationReconciler

func NewAtlasMigrationReconciler(mgr Manager, atlas AtlasExecFn, prewarmDevDB bool) *AtlasMigrationReconciler

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) SetupWithManager

func (r *AtlasMigrationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type AtlasSchemaReconciler

type AtlasSchemaReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

AtlasSchemaReconciler reconciles a AtlasSchema object

func NewAtlasSchemaReconciler

func NewAtlasSchemaReconciler(mgr Manager, atlas AtlasExecFn, prewarmDevDB bool) *AtlasSchemaReconciler

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) SetupWithManager

func (r *AtlasSchemaReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type Cloud

type Cloud struct {
	Token string
	Repo  string
	URL   string
}

Cloud holds the cloud configuration.

type Manager

type Manager interface {
	GetClient() client.Client
	GetScheme() *runtime.Scheme
	GetEventRecorderFor(name string) record.EventRecorder
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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