storage

package
v1.1.9-alpha.8 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocalStage_ImageRepoPrefix = "werf-stages-storage/"
	LocalStage_ImageRepoFormat = "werf-stages-storage/%s"
	LocalStage_ImageFormat     = "werf-stages-storage/%s:%s-%s"

	LocalManagedImageRecord_ImageNamePrefix = "werf-managed-images/"
	LocalManagedImageRecord_ImageNameFormat = "werf-managed-images/%s"
	LocalManagedImageRecord_ImageFormat     = "werf-managed-images/%s:%s"
)
View Source
const (
	RepoStage_ImageTagFormat = "%s-%s"
	RepoStage_ImageFormat    = "%s:%s-%s"

	RepoManagedImageRecord_ImageTagPrefix  = "managed-image-"
	RepoManagedImageRecord_ImageTagFormat  = "managed-image-%s"
	RepoManagedImageRecord_ImageNameFormat = "%s:managed-image-%s"
)
View Source
const (
	LocalStagesStorageAddress = ":local"
	NamelessImageRecordTag    = "__nameless__"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteImageOptions added in v1.1.9

type DeleteImageOptions struct {
	RmiForce                 bool
	SkipUsedImage            bool
	RmForce                  bool
	RmContainersThatUseImage bool
}

type DockerImagesRepo added in v1.1.9

type DockerImagesRepo struct {
	docker_registry.DockerRegistry
	// contains filtered or unexported fields
}

func (*DockerImagesRepo) CreateImageRepo added in v1.1.9

func (repo *DockerImagesRepo) CreateImageRepo(imageName string) error

func (*DockerImagesRepo) DeleteImageRepo added in v1.1.9

func (repo *DockerImagesRepo) DeleteImageRepo(imageName string) error

func (*DockerImagesRepo) DeleteRepoImage added in v1.1.9

func (repo *DockerImagesRepo) DeleteRepoImage(_ DeleteImageOptions, repoImageList ...*image.Info) error

func (*DockerImagesRepo) GetAllImageRepoTags added in v1.1.9

func (repo *DockerImagesRepo) GetAllImageRepoTags(imageName string) ([]string, error)

func (*DockerImagesRepo) GetRepoImage added in v1.1.9

func (repo *DockerImagesRepo) GetRepoImage(imageName, tag string) (*image.Info, error)

func (*DockerImagesRepo) GetRepoImages added in v1.1.9

func (repo *DockerImagesRepo) GetRepoImages(imageNames []string) (map[string][]*image.Info, error)

func (DockerImagesRepo) ImageRepo added in v1.1.9

func (m DockerImagesRepo) ImageRepo(imageName string) string

func (DockerImagesRepo) ImageRepoTag added in v1.1.9

func (m DockerImagesRepo) ImageRepoTag(imageName, tag string) string

func (DockerImagesRepo) ImageRepoWithTag added in v1.1.9

func (m DockerImagesRepo) ImageRepoWithTag(imageName, tag string) string

func (*DockerImagesRepo) ImageRepositoryName added in v1.1.9

func (repo *DockerImagesRepo) ImageRepositoryName(imageName string) string

func (*DockerImagesRepo) ImageRepositoryNameWithTag added in v1.1.9

func (repo *DockerImagesRepo) ImageRepositoryNameWithTag(imageName, tag string) string

func (*DockerImagesRepo) ImageRepositoryTag added in v1.1.9

func (repo *DockerImagesRepo) ImageRepositoryTag(imageName, tag string) string

func (DockerImagesRepo) ImagesRepo added in v1.1.9

func (m DockerImagesRepo) ImagesRepo() string

func (DockerImagesRepo) IsMonorepo added in v1.1.9

func (m DockerImagesRepo) IsMonorepo() bool

func (*DockerImagesRepo) PublishImage added in v1.1.9

func (repo *DockerImagesRepo) PublishImage(publishImage *container_runtime.WerfImage) error

FIXME: use docker-registry object

func (*DockerImagesRepo) String added in v1.1.9

func (repo *DockerImagesRepo) String() string

type DockerImagesRepoOptions added in v1.1.9

type DockerImagesRepoOptions struct {
	docker_registry.DockerRegistryOptions
	Implementation string
}

type FileLockManager

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

func (*FileLockManager) LockAllImagesReadOnly

func (lockManager *FileLockManager) LockAllImagesReadOnly(projectName string) error

func (*FileLockManager) LockImage

func (lockManager *FileLockManager) LockImage(imageName string) error

func (*FileLockManager) LockStage

func (lockManager *FileLockManager) LockStage(projectName, signature string) error

func (*FileLockManager) LockStageCache

func (lockManager *FileLockManager) LockStageCache(projectName, signature string) error

func (*FileLockManager) LockStagesAndImages added in v1.1.9

func (lockManager *FileLockManager) LockStagesAndImages(projectName string, opts LockStagesAndImagesOptions) error

func (*FileLockManager) ReleaseAllStageLocks

func (lockManager *FileLockManager) ReleaseAllStageLocks() error

func (*FileLockManager) UnlockAllImages

func (lockManager *FileLockManager) UnlockAllImages(projectName string) error

func (*FileLockManager) UnlockImage

func (lockManager *FileLockManager) UnlockImage(imageName string) error

func (*FileLockManager) UnlockStage

func (lockManager *FileLockManager) UnlockStage(projectName, signature string) error

func (*FileLockManager) UnlockStageCache

func (lockManager *FileLockManager) UnlockStageCache(projectName, signature string) error

func (*FileLockManager) UnlockStagesAndImages added in v1.1.9

func (lockManager *FileLockManager) UnlockStagesAndImages(projectName string) error

type FileStagesStorageCache

type FileStagesStorageCache struct {
	CacheDir string
}

func NewFileStagesStorageCache

func NewFileStagesStorageCache(cacheDir string) *FileStagesStorageCache

func (*FileStagesStorageCache) DeleteStagesBySignature added in v1.1.9

func (cache *FileStagesStorageCache) DeleteStagesBySignature(projectName, signature string) error

func (*FileStagesStorageCache) GetAllStages added in v1.1.9

func (cache *FileStagesStorageCache) GetAllStages(projectName string) (bool, []image.StageID, error)

func (*FileStagesStorageCache) GetStagesBySignature added in v1.1.9

func (cache *FileStagesStorageCache) GetStagesBySignature(projectName, signature string) (bool, []image.StageID, error)

func (*FileStagesStorageCache) StoreStagesBySignature added in v1.1.9

func (cache *FileStagesStorageCache) StoreStagesBySignature(projectName, signature string, stages []image.StageID) error

type ImagesRepo added in v1.1.9

type ImagesRepo interface {
	GetRepoImage(imageName, tag string) (*image.Info, error)
	GetRepoImages(imageNames []string) (map[string][]*image.Info, error)
	DeleteRepoImage(_ DeleteImageOptions, repoImageList ...*image.Info) error

	GetAllImageRepoTags(imageName string) ([]string, error)
	PublishImage(publishImage *container_runtime.WerfImage) error

	CreateImageRepo(imageName string) error
	DeleteImageRepo(imageName string) error

	ImageRepositoryName(imageName string) string
	ImageRepositoryNameWithTag(imageName, tag string) string
	ImageRepositoryTag(imageName, tag string) string

	String() string
}

func NewDockerImagesRepo added in v1.1.9

func NewDockerImagesRepo(projectName, imagesRepoAddress, imagesRepoMode string, options DockerImagesRepoOptions) (ImagesRepo, error)

func NewImagesRepo added in v1.1.9

func NewImagesRepo(projectName, imagesRepoAddress, imagesRepoMode string, options ImagesRepoOptions) (ImagesRepo, error)

type ImagesRepoOptions added in v1.1.9

type ImagesRepoOptions struct {
	DockerImagesRepoOptions
}

type LocalDockerServerStagesStorage added in v1.1.9

type LocalDockerServerStagesStorage struct {
	// Local stages storage is compatible only with docker-server backed runtime
	LocalDockerServerRuntime *container_runtime.LocalDockerServerRuntime
}

func NewLocalDockerServerStagesStorage added in v1.1.9

func NewLocalDockerServerStagesStorage(localDockerServerRuntime *container_runtime.LocalDockerServerRuntime) *LocalDockerServerStagesStorage

func (*LocalDockerServerStagesStorage) AddManagedImage added in v1.1.9

func (storage *LocalDockerServerStagesStorage) AddManagedImage(projectName, imageName string) error

func (*LocalDockerServerStagesStorage) ConstructStageImageName added in v1.1.9

func (storage *LocalDockerServerStagesStorage) ConstructStageImageName(projectName, signature, uniqueID string) string

func (*LocalDockerServerStagesStorage) CreateRepo added in v1.1.9

func (storage *LocalDockerServerStagesStorage) CreateRepo() error

func (*LocalDockerServerStagesStorage) DeleteRepo added in v1.1.9

func (storage *LocalDockerServerStagesStorage) DeleteRepo() error

func (*LocalDockerServerStagesStorage) DeleteStages added in v1.1.9

func (storage *LocalDockerServerStagesStorage) DeleteStages(options DeleteImageOptions, stages ...*image.StageDescription) error

func (*LocalDockerServerStagesStorage) FetchImage added in v1.1.9

func (*LocalDockerServerStagesStorage) GetAllStages added in v1.1.9

func (storage *LocalDockerServerStagesStorage) GetAllStages(projectName string) ([]image.StageID, error)

func (*LocalDockerServerStagesStorage) GetManagedImages added in v1.1.9

func (storage *LocalDockerServerStagesStorage) GetManagedImages(projectName string) ([]string, error)

func (*LocalDockerServerStagesStorage) GetStageDescription added in v1.1.9

func (storage *LocalDockerServerStagesStorage) GetStageDescription(projectName, signature, uniqueID string) (*image.StageDescription, error)

func (*LocalDockerServerStagesStorage) GetStagesBySignature added in v1.1.9

func (storage *LocalDockerServerStagesStorage) GetStagesBySignature(projectName, signature string) ([]image.StageID, error)

func (*LocalDockerServerStagesStorage) RmManagedImage added in v1.1.9

func (storage *LocalDockerServerStagesStorage) RmManagedImage(projectName, imageName string) error

func (*LocalDockerServerStagesStorage) ShouldFetchImage added in v1.1.9

func (storage *LocalDockerServerStagesStorage) ShouldFetchImage(img container_runtime.Image) (bool, error)

func (*LocalDockerServerStagesStorage) StoreImage added in v1.1.9

func (*LocalDockerServerStagesStorage) String added in v1.1.9

func (storage *LocalDockerServerStagesStorage) String() string

type LockManager

type LockManager interface {
	LockStage(projectName, signature string) error
	UnlockStage(projectName, signature string) error

	LockStageCache(projectName, signature string) error
	UnlockStageCache(projectName, signature string) error

	LockImage(imageName string) error
	UnlockImage(imageName string) error

	LockStagesAndImages(projectName string, opts LockStagesAndImagesOptions) error
	UnlockStagesAndImages(projectName string) error
}

type LockStagesAndImagesOptions added in v1.1.9

type LockStagesAndImagesOptions struct {
	GetOrCreateImagesOnly bool
}

type RepoStagesStorage added in v1.1.9

type RepoStagesStorage struct {
	RepoAddress      string
	DockerRegistry   docker_registry.DockerRegistry
	ContainerRuntime container_runtime.ContainerRuntime
}

func NewRepoStagesStorage added in v1.1.9

func NewRepoStagesStorage(repoAddress string, containerRuntime container_runtime.ContainerRuntime, options RepoStagesStorageOptions) (*RepoStagesStorage, error)

func (*RepoStagesStorage) AddManagedImage added in v1.1.9

func (storage *RepoStagesStorage) AddManagedImage(projectName, imageName string) error

func (*RepoStagesStorage) ConstructStageImageName added in v1.1.9

func (storage *RepoStagesStorage) ConstructStageImageName(projectName, signature, uniqueID string) string

func (*RepoStagesStorage) CreateRepo added in v1.1.9

func (storage *RepoStagesStorage) CreateRepo() error

func (*RepoStagesStorage) DeleteRepo added in v1.1.9

func (storage *RepoStagesStorage) DeleteRepo() error

func (*RepoStagesStorage) DeleteStages added in v1.1.9

func (storage *RepoStagesStorage) DeleteStages(options DeleteImageOptions, stages ...*image.StageDescription) error

func (*RepoStagesStorage) FetchImage added in v1.1.9

func (storage *RepoStagesStorage) FetchImage(img container_runtime.Image) error

func (*RepoStagesStorage) GetAllStages added in v1.1.9

func (storage *RepoStagesStorage) GetAllStages(projectName string) ([]image.StageID, error)

func (*RepoStagesStorage) GetManagedImages added in v1.1.9

func (storage *RepoStagesStorage) GetManagedImages(projectName string) ([]string, error)

func (*RepoStagesStorage) GetStageDescription added in v1.1.9

func (storage *RepoStagesStorage) GetStageDescription(projectName, signature, uniqueID string) (*image.StageDescription, error)

func (*RepoStagesStorage) GetStagesBySignature added in v1.1.9

func (storage *RepoStagesStorage) GetStagesBySignature(projectName, signature string) ([]image.StageID, error)

func (*RepoStagesStorage) RmManagedImage added in v1.1.9

func (storage *RepoStagesStorage) RmManagedImage(projectName, imageName string) error

func (*RepoStagesStorage) ShouldFetchImage added in v1.1.9

func (storage *RepoStagesStorage) ShouldFetchImage(img container_runtime.Image) (bool, error)

func (*RepoStagesStorage) StoreImage added in v1.1.9

func (storage *RepoStagesStorage) StoreImage(img container_runtime.Image) error

func (*RepoStagesStorage) String added in v1.1.9

func (storage *RepoStagesStorage) String() string

type RepoStagesStorageOptions added in v1.1.9

type RepoStagesStorageOptions struct {
	docker_registry.DockerRegistryOptions
	Implementation string
}

type StagesStorage

type StagesStorage interface {
	GetAllStages(projectName string) ([]image.StageID, error)
	GetStagesBySignature(projectName, signature string) ([]image.StageID, error)
	GetStageDescription(projectName, signature, uniqueID string) (*image.StageDescription, error)
	DeleteStages(options DeleteImageOptions, stages ...*image.StageDescription) error

	ConstructStageImageName(projectName, signature, uniqueID string) string

	// FetchImage will create a local image in the container-runtime
	FetchImage(img container_runtime.Image) error
	// StoreImage will store a local image into the container-runtime, local built image should exist prior running store
	StoreImage(img container_runtime.Image) error
	ShouldFetchImage(img container_runtime.Image) (bool, error)

	CreateRepo() error
	DeleteRepo() error

	AddManagedImage(projectName, imageName string) error
	RmManagedImage(projectName, imageName string) error
	GetManagedImages(projectName string) ([]string, error)

	String() string
}

func NewStagesStorage added in v1.1.9

func NewStagesStorage(stagesStorageAddress string, containerRuntime container_runtime.ContainerRuntime, options StagesStorageOptions) (StagesStorage, error)

type StagesStorageCache

type StagesStorageCache interface {
	GetAllStages(projectName string) (bool, []image.StageID, error)
	GetStagesBySignature(projectName, signature string) (bool, []image.StageID, error)
	StoreStagesBySignature(projectName, signature string, stages []image.StageID) error
	DeleteStagesBySignature(projectName, signature string) error
}

type StagesStorageCacheRecord added in v1.1.9

type StagesStorageCacheRecord struct {
	Stages []image.StageID `json:"stages"`
}

type StagesStorageOptions added in v1.1.9

type StagesStorageOptions struct {
	RepoStagesStorageOptions
}

Jump to

Keyboard shortcuts

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