manager

package
v1.1.24 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrShouldResetStagesStorageCache = errors.New("should reset stages storage cache")

Functions

func ShouldResetStagesStorageCache

func ShouldResetStagesStorageCache(err error) bool

func SyncStages

func SyncStages(ctx context.Context, projectName string, fromStagesStorage storage.StagesStorage, toStagesStorage storage.StagesStorage, storageLockManager storage.LockManager, containerRuntime container_runtime.ContainerRuntime, opts SyncStagesOptions) error

SyncStages will make sure, that destination stages storage contains all stages from source stages storage. Repeatedly calling SyncStages will copy stages from source stages storage to destination, that already exists in the destination. SyncStages will not delete excess stages from destination storage, that does not exists in the source.

Types

type ImagesRepoManager

type ImagesRepoManager struct {
	ImagesRepo storage.ImagesRepo
	// contains filtered or unexported fields
}

func (*ImagesRepoManager) EnableParallel

func (m *ImagesRepoManager) EnableParallel(parallelTasksLimit int)

func (*ImagesRepoManager) ForEachDeleteRepoImage

func (m *ImagesRepoManager) ForEachDeleteRepoImage(ctx context.Context, repoImageList []*image.Info, f func(imageInfo *image.Info, err error) error) error

func (*ImagesRepoManager) GetRepoImage

func (m *ImagesRepoManager) GetRepoImage(ctx context.Context, imageName, tag string) (*image.Info, error)

func (*ImagesRepoManager) MaxNumberOfWorkers

func (m *ImagesRepoManager) MaxNumberOfWorkers() int

func (*ImagesRepoManager) SelectRepoImages

func (m *ImagesRepoManager) SelectRepoImages(ctx context.Context, imageNames []string, f func(string, *image.Info, error) (bool, error)) (map[string][]*image.Info, error)

type StagesStorageManager

type StagesStorageManager struct {
	StagesSwitchFromLocalBlockDir string
	ProjectName                   string

	StorageLockManager storage.LockManager
	StagesStorage      storage.StagesStorage
	StagesStorageCache storage.StagesStorageCache

	// These will be released automatically when current process exits
	SharedHostImagesLocks []lockgate.LockHandle
	// contains filtered or unexported fields
}

func (*StagesStorageManager) AtomicStoreStagesBySignatureToCache

func (m *StagesStorageManager) AtomicStoreStagesBySignatureToCache(ctx context.Context, stageName, stageSig string, stageIDs []image.StageID) error

func (*StagesStorageManager) EnableParallel

func (m *StagesStorageManager) EnableParallel(parallelTasksLimit int)

func (*StagesStorageManager) FetchStage

func (m *StagesStorageManager) FetchStage(ctx context.Context, stg stage.Interface) error

func (*StagesStorageManager) ForEachDeleteStage

func (m *StagesStorageManager) ForEachDeleteStage(ctx context.Context, options ForEachDeleteStageOptions, stagesDescriptions []*image.StageDescription, f func(stageDesc *image.StageDescription, err error) error) error

func (*StagesStorageManager) ForEachGetImageMetadataByCommit

func (m *StagesStorageManager) ForEachGetImageMetadataByCommit(ctx context.Context, projectName, imageName string, f func(commit string, imageMetadata *storage.ImageMetadata, err error) error) error

func (*StagesStorageManager) ForEachRmImageCommit

func (m *StagesStorageManager) ForEachRmImageCommit(ctx context.Context, projectName, imageName string, commits []string, f func(commit string, err error) error) error

func (*StagesStorageManager) GenerateStageUniqueID

func (m *StagesStorageManager) GenerateStageUniqueID(signature string, stages []*image.StageDescription) (string, int64)

func (*StagesStorageManager) GetAllStages

func (m *StagesStorageManager) GetAllStages(ctx context.Context) ([]*image.StageDescription, error)

func (*StagesStorageManager) GetStagesBySignature

func (m *StagesStorageManager) GetStagesBySignature(ctx context.Context, stageName, stageSig string) ([]*image.StageDescription, error)

func (*StagesStorageManager) LockStageImage added in v1.1.24

func (m *StagesStorageManager) LockStageImage(ctx context.Context, imageName string) error

func (*StagesStorageManager) MaxNumberOfWorkers

func (m *StagesStorageManager) MaxNumberOfWorkers() int

func (*StagesStorageManager) ResetStagesStorageCache

func (m *StagesStorageManager) ResetStagesStorageCache(ctx context.Context) error

func (*StagesStorageManager) SelectSuitableStage

func (*StagesStorageManager) SetStagesSwitchFromLocalBlock

func (m *StagesStorageManager) SetStagesSwitchFromLocalBlock(ctx context.Context, newStagesStorage storage.StagesStorage) error

func (*StagesStorageManager) UseStagesStorage

func (m *StagesStorageManager) UseStagesStorage(ctx context.Context, stagesStorage storage.StagesStorage) error

type StorageManager

type StorageManager struct {
	*ImagesRepoManager
	*StagesStorageManager
}

func NewStorageManager

func NewStorageManager(projectName string, storageLockManager storage.LockManager, stagesStorageCache storage.StagesStorageCache) *StorageManager

func (*StorageManager) SetImageRepo

func (m *StorageManager) SetImageRepo(imagesRepo storage.ImagesRepo)

type SyncStagesOptions

type SyncStagesOptions struct {
	RemoveSource      bool
	CleanupLocalCache bool
}

Jump to

Keyboard shortcuts

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