migration

package
v0.0.0-...-3638617 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Package migration provides implementation for CR migration from Giant Swarm flavor to upstream compatible CAPI.

Index

Constants

View Source
const (
	EncryptionSecret = "EncryptionSecret"
)

Variables

This section is empty.

Functions

func IsAzureNotFound

func IsAzureNotFound(err error) bool

IsAzureNotFound detects an azure API 404 error.

Types

type AWSConfig

type AWSConfig struct {
	AccessKeyID     string
	AccessKeySecret string

	Region  string
	RoleARN string
}

type AWSMigrationConfig

type AWSMigrationConfig struct {
	// Migration configuration + dependencies such as k8s client.
	AWSCredentials AWSConfig
	CtrlClient     ctrl.Client
	Logger         micrologger.Logger
	TenantCluster  tenantcluster.Interface
}

type AzureMigrationConfig

type AzureMigrationConfig struct {
	// Migration configuration + dependencies such as k8s client.
	CtrlClient    ctrl.Client
	Logger        micrologger.Logger
	TenantCluster tenantcluster.Interface
}

type Migrator

type Migrator interface {
	// Cleanup performs cleanup operations after migration has been completed.
	Cleanup(ctx context.Context) error

	// IsMigrated performs check to see if given cluster has been already
	// migrated.
	IsMigrated(ctx context.Context) (bool, error)

	// IsMigrating performs check to see if given cluster has migration
	// triggered already.
	IsMigrating(ctx context.Context) (bool, error)

	// Prepare executes preparatory migration actions such as transforming
	// existing CRs into upstream compatible format and creating missing CRs.
	Prepare(ctx context.Context) error

	// TriggerMigration performs final execution which shifts reconciliation to
	// upstream controllers.
	TriggerMigration(ctx context.Context) error
}

type MigratorFactory

type MigratorFactory interface {
	// Construct new Migrator for given cluster.
	NewMigrator(cluster *v1alpha3.Cluster) (Migrator, error)
}

func NewAWSMigratorFactory

func NewAWSMigratorFactory(cfg AWSMigrationConfig) (MigratorFactory, error)

func NewAzureMigratorFactory

func NewAzureMigratorFactory(cfg AzureMigrationConfig) (MigratorFactory, error)

Directories

Path Synopsis
internal
key

Jump to

Keyboard shortcuts

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