migration

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package migration provides functionality for data migration operations in Kubernetes. This package includes components for creating, running, and monitoring Kubernetes jobs that perform data import and migration tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFinalMigration

func IsFinalMigration(ctx context.Context) bool

func SetFinalMigration

func SetFinalMigration(ctx context.Context) context.Context

func SetTriggerFQDNChange

func SetTriggerFQDNChange(ctx context.Context) context.Context

func SetTriggerFQDNChangeFromEnv

func SetTriggerFQDNChangeFromEnv(ctx context.Context) context.Context

func TriggerFQDNChange

func TriggerFQDNChange(ctx context.Context) bool

Types

type DoguStarter

type DoguStarter interface {
	StartAll(ctx context.Context) error
}

type DoguStopper

type DoguStopper interface {
	StopAll(ctx context.Context) error
}

type ExportModeValidator

type ExportModeValidator interface {
	Validate(ctx context.Context) error
}

type ExportModeValidatorApiClient

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

func NewExportModeValidatorApiClient

func NewExportModeValidatorApiClient(apiClient exportModeClient) *ExportModeValidatorApiClient

func (*ExportModeValidatorApiClient) Validate

type JobProviderDependencies

type JobProviderDependencies struct {
	JobContainerConfig configuration.JobContainer
	SSHConfig          configuration.SSH
	APIKey             string
	DoguVolumeBasePath string
	PVCClient          pvcClient
}

type JobRunner

type JobRunner interface {
	Run(ctx context.Context) (io.ReadCloser, error)
}

type JobService

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

JobService orchestrates the creation, execution, and monitoring of Kubernetes jobs It provides functionality to run jobs, watch their status, and retrieve their logs

func NewJobService

func NewJobService(deps JobServiceDependencies) (*JobService, error)

NewJobService creates a new JobService with the provided dependencies It initializes the job provider and sets up the necessary functions for watching jobs and streaming logs Returns an error if the job provider cannot be created

func (JobService) Run

func (j JobService) Run(ctx context.Context) (jobLogs io.ReadCloser, err error)

Run creates and executes a Kubernetes job, watches for its completion, and returns its logs It performs the following steps: 1. Creates a job specification using the job creator 2. Submits the job to the Kubernetes API 3. Sets up a watcher to monitor the job's status 4. Waits for the job to complete or fail 5. Retrieves and returns the job's logs

The method returns an io.ReadCloser containing the job logs if successful, or an error if any step in the process fails

type JobServiceDependencies

type JobServiceDependencies struct {
	JobProviderDependencies
	JobClient jobClient
	PodClient podClient
}

JobServiceDependencies contains all the dependencies required to create a JobService It includes dependencies for job creation, job client for interacting with Kubernetes jobs, and pod client for accessing pod information and logs

type LogInitializer

type LogInitializer interface {
	InitializeWithLogFile() error
}

type LogWriter

type LogWriter interface {
	Write(io.ReadCloser) error
}

type MailSender

type MailSender interface {
	Send(ctx context.Context, isFinal bool, migrationResult error, startTime time.Time, endTime time.Time) error
}

type MaintenanceModeHandler

type MaintenanceModeHandler interface {
	Enable(ctx context.Context) error
	Disable(ctx context.Context) error
}

type Migrator

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

func NewMigrator

func NewMigrator(dependencies MigratorDependencies) *Migrator

func (Migrator) RunMigration

func (m Migrator) RunMigration(ctx context.Context) (err error)

type PVCGetter

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

func NewPVCGetter

func NewPVCGetter(client v1.PersistentVolumeClaimInterface) *PVCGetter

func (PVCGetter) GetDoguVolumes

func (p PVCGetter) GetDoguVolumes(ctx context.Context) ([]doguPVC, error)

type SystemInfoValidator

type SystemInfoValidator interface {
	Validate(ctx context.Context) error
}

Directories

Path Synopsis
Package sync provides functions to copy data from the exporter system to the importer system (where this application is running).
Package sync provides functions to copy data from the exporter system to the importer system (where this application is running).

Jump to

Keyboard shortcuts

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