migrator

package
v0.0.0-...-cbfbdd4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerVolumeRefsCount

func ContainerVolumeRefsCount(c *pouch.PouchContainer, volumeRefs map[string]string) error

ContainerVolumeRefsCount count a container's reference to volumes

Types

type Migrator

type Migrator interface {
	// PreMigrate do something before migration
	PreMigrate(ctx context.Context, takeOverContainer bool) error

	// Migrate does migrate action
	Migrate(ctx context.Context, takeOverContainer bool) error

	// PostMigrate do something after migration
	PostMigrate(ctx context.Context, takeOverContainer bool) error

	// RevertMigration reverts migration
	RevertMigration(ctx context.Context, takeOverContainer bool) error

	// Cleanup does some clean works when migrator exited
	Cleanup() error

	// PrepareImages just pull images for containers
	PrepareImages(ctx context.Context) error
}

Migrator is an interface to migrate docker containers to other containers

func NewPouchMigrator

func NewPouchMigrator(dockerPkg, pouchPkgPath string, debug, dryRun bool) (Migrator, error)

NewPouchMigrator creates a migrator tool instance.

type PouchMigrator

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

PouchMigrator is a tool to migrate docker containers to pouch containers

func (*PouchMigrator) Cleanup

func (p *PouchMigrator) Cleanup() error

Cleanup does some clean works when migrator exited.

func (*PouchMigrator) Migrate

func (p *PouchMigrator) Migrate(ctx context.Context, takeOverContainer bool) error

Migrate migrates docker containers to pouch containers: * stop all docker containers * mv oldUpperDir/* newUpperDir/

func (*PouchMigrator) PostMigrate

func (p *PouchMigrator) PostMigrate(ctx context.Context, takeOverContainer bool) error

PostMigrate does something after migration.

func (*PouchMigrator) PreMigrate

func (p *PouchMigrator) PreMigrate(ctx context.Context, takeOverContainer bool) error

PreMigrate prepares things for migration * pull image to pouch * create snapshot for container * set snapshot upperDir, workDir diskquota * convert docker container metaJSON to pouch container metaJSON

func (*PouchMigrator) PrepareImages

func (p *PouchMigrator) PrepareImages(ctx context.Context) error

PrepareImages just pull images for containers

func (*PouchMigrator) RevertMigration

func (p *PouchMigrator) RevertMigration(ctx context.Context, takeOverContainer bool) error

RevertMigration reverts migration.

type Store

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

Store is a store of volume

func NewStore

func NewStore(baseDir string) (*Store, error)

NewStore initializes a boltdb store for volume store.

func (*Store) CreateVolumes

func (s *Store) CreateVolumes(volumes []*volumetypes.Volume) error

CreateVolumes put all volumes information to volume boltdb

func (*Store) Shutdown

func (s *Store) Shutdown() error

Shutdown close the store's boltdb

type UpperDirMapping

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

UpperDirMapping stores overlayfs upperDir map for docker and pouch.

Jump to

Keyboard shortcuts

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