storage

package
v1.2.322 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const (
	LocalStage_ImageRepoFormat           = "%s"
	LocalStage_ImageFormatWithCreationTs = "%s:%s-%d"
	LocalStage_ImageFormat               = "%s:%s"

	LocalImportMetadata_ImageNameFormat = "werf-import-metadata/%s"
	LocalImportMetadata_TagFormat       = "%s"

	LocalClientIDRecord_ImageNameFormat = "werf-client-id/%s"
	LocalClientIDRecord_ImageFormat     = "werf-client-id/%s:%s-%d"

	ImageDeletionFailedDueToUsedByContainerErrorTip = "Use --force option to remove all containers that are based on deleting werf docker images"
)
View Source
const (
	RepoStage_ImageFormatWithCreationTs = "%s:%s-%d"
	RepoStage_ImageFormat               = "%s:%s"

	RepoManagedImageRecord_ImageTagPrefix  = "managed-image-"
	RepoManagedImageRecord_ImageNameFormat = "%s:managed-image-%s"

	RepoRejectedStageImageRecord_ImageTagSuffix  = "-rejected"
	RepoRejectedStageImageRecord_ImageNameFormat = "%s:%s-%d-rejected"

	RepoImageMetadataByCommitRecord_ImageTagPrefix = "meta-"
	RepoImageMetadataByCommitRecord_TagFormat      = "meta-%s_%s_%s"

	RepoCustomTagMetadata_ImageTagPrefix  = "custom-tag-meta-"
	RepoCustomTagMetadata_ImageNameFormat = "%s:custom-tag-meta-%s"

	RepoImportMetadata_ImageTagPrefix  = "import-metadata-"
	RepoImportMetadata_ImageNameFormat = "%s:import-metadata-%s"

	RepoClientIDRecord_ImageTagPrefix  = "client-id-"
	RepoClientIDRecord_ImageNameFormat = "%s:client-id-%s-%d"

	UnexpectedTagFormatErrorPrefix = "unexpected tag format"
)
View Source
const (
	LocalStorageAddress             = ":local"
	DefaultKubernetesStorageAddress = "kubernetes://werf-synchronization"
	NamelessImageRecordTag          = "__nameless__"
)
View Source
const (
	StagesStorageCacheConfigMapKey = "stagesStorageCache"
)

Variables

View Source
var DefaultHttpSynchronizationServer = "https://synchronization.werf.io"
View Source
var ErrBadKubernetesSynchronizationAddress = errors.New("bad kubernetes synchronization address")
View Source
var ErrBrokenImage = errors.New("broken image")

Functions

func IsErrBrokenImage added in v1.2.68

func IsErrBrokenImage(err error) bool

func IsImageDeletionFailedDueToUsingByContainerErr added in v1.2.14

func IsImageDeletionFailedDueToUsingByContainerErr(err error) bool

Types

type ClientIDRecord added in v1.1.23

type ClientIDRecord struct {
	ClientID          string
	TimestampMillisec int64
}

func (*ClientIDRecord) String added in v1.1.23

func (rec *ClientIDRecord) String() string

type CopyFromStorageOptions added in v1.2.225

type CopyFromStorageOptions struct {
	IsMultiplatformImage bool
}

type CustomTagMetadata added in v1.2.28

type CustomTagMetadata struct {
	StageID string
	Tag     string
}

func (*CustomTagMetadata) ToLabels added in v1.2.28

func (m *CustomTagMetadata) ToLabels() map[string]string

type DeleteImageOptions

type DeleteImageOptions struct {
	RmiForce bool
}

type FileStagesStorageCache

type FileStagesStorageCache struct {
	CacheDir string
}

func NewFileStagesStorageCache

func NewFileStagesStorageCache(cacheDir string) *FileStagesStorageCache

func (*FileStagesStorageCache) DeleteAllStages

func (cache *FileStagesStorageCache) DeleteAllStages(_ context.Context, projectName string) error

func (*FileStagesStorageCache) DeleteStagesByDigest added in v1.2.0

func (cache *FileStagesStorageCache) DeleteStagesByDigest(ctx context.Context, projectName, digest string) error

func (*FileStagesStorageCache) GetAllStages

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

func (*FileStagesStorageCache) GetStagesByDigest added in v1.2.0

func (cache *FileStagesStorageCache) GetStagesByDigest(ctx context.Context, projectName, digest string) (bool, []image.StageID, error)

func (*FileStagesStorageCache) StoreStagesByDigest added in v1.2.0

func (cache *FileStagesStorageCache) StoreStagesByDigest(ctx context.Context, projectName, digest string, stages []image.StageID) error

func (*FileStagesStorageCache) String

func (cache *FileStagesStorageCache) String() string

type FilterStagesAndProcessRelatedDataOptions added in v1.1.23

type FilterStagesAndProcessRelatedDataOptions struct {
	SkipUsedImage            bool
	RmForce                  bool
	RmContainersThatUseImage bool
}

type GenericLockManager

type GenericLockManager struct {
	// Single Locker for all projects
	Locker lockgate.Locker
}

func NewGenericLockManager

func NewGenericLockManager(locker lockgate.Locker) *GenericLockManager

func (*GenericLockManager) LockStage

func (manager *GenericLockManager) LockStage(ctx context.Context, projectName, digest string) (LockHandle, error)

func (*GenericLockManager) LockStageCache

func (manager *GenericLockManager) LockStageCache(ctx context.Context, projectName, digest string) (LockHandle, error)

func (*GenericLockManager) Unlock

func (manager *GenericLockManager) Unlock(ctx context.Context, lock LockHandle) error

type ImageMetadata

type ImageMetadata struct {
	ContentDigest string
}

type ImportMetadata added in v1.2.0

type ImportMetadata struct {
	ImportSourceID string
	SourceImageID  string
	Checksum       string
}

func (*ImportMetadata) ToLabels added in v1.2.0

func (m *ImportMetadata) ToLabels() []string

func (*ImportMetadata) ToLabelsMap added in v1.2.223

func (m *ImportMetadata) ToLabelsMap() map[string]string

type KubernetesLockManager added in v1.2.26

type KubernetesLockManager struct {
	KubeClient           kubernetes.Interface
	KubeDynamicClient    dynamic.Interface
	Namespace            string
	LockerPerProject     map[string]lockgate.Locker
	GetConfigMapNameFunc func(projectName string) string
	// contains filtered or unexported fields
}

func NewKubernetesLockManager

func NewKubernetesLockManager(namespace string, kubeClient kubernetes.Interface, kubeDynamicClient dynamic.Interface, getConfigMapNameFunc func(projectName string) string) *KubernetesLockManager

func (*KubernetesLockManager) LockStage added in v1.2.26

func (manager *KubernetesLockManager) LockStage(ctx context.Context, projectName, digest string) (LockHandle, error)

func (*KubernetesLockManager) LockStageCache added in v1.2.26

func (manager *KubernetesLockManager) LockStageCache(ctx context.Context, projectName, digest string) (LockHandle, error)

func (*KubernetesLockManager) Unlock added in v1.2.26

func (manager *KubernetesLockManager) Unlock(ctx context.Context, lock LockHandle) error

type KubernetesStagesStorageCache

type KubernetesStagesStorageCache struct {
	KubeClient           kubernetes.Interface
	Namespace            string
	GetConfigMapNameFunc func(projectName string) string
}

func NewKubernetesStagesStorageCache

func NewKubernetesStagesStorageCache(namespace string, kubeClient kubernetes.Interface, getConfigMapNameFunc func(projectName string) string) *KubernetesStagesStorageCache

func (*KubernetesStagesStorageCache) DeleteAllStages

func (cache *KubernetesStagesStorageCache) DeleteAllStages(ctx context.Context, projectName string) error

func (*KubernetesStagesStorageCache) DeleteStagesByDigest added in v1.2.0

func (cache *KubernetesStagesStorageCache) DeleteStagesByDigest(ctx context.Context, projectName, digest string) error

func (*KubernetesStagesStorageCache) GetAllStages

func (cache *KubernetesStagesStorageCache) GetAllStages(ctx context.Context, projectName string) (bool, []image.StageID, error)

func (*KubernetesStagesStorageCache) GetStagesByDigest added in v1.2.0

func (cache *KubernetesStagesStorageCache) GetStagesByDigest(ctx context.Context, projectName, digest string) (bool, []image.StageID, error)

func (*KubernetesStagesStorageCache) StoreStagesByDigest added in v1.2.0

func (cache *KubernetesStagesStorageCache) StoreStagesByDigest(ctx context.Context, projectName, digest string, stages []image.StageID) error

func (*KubernetesStagesStorageCache) String

func (cache *KubernetesStagesStorageCache) String() string

type KubernetesStagesStorageCacheData

type KubernetesStagesStorageCacheData struct {
	StagesByDigest map[string][]image.StageID `json:"stagesByDigest"`
}

type KubernetesStagesStorageCacheOptions added in v1.1.23

type KubernetesStagesStorageCacheOptions struct {
	GetConfigMapNameFunc func(projectName string) string
}

type KubernetesSynchronizationParams added in v1.1.23

type KubernetesSynchronizationParams struct {
	ConfigContext       string
	ConfigPath          string
	ConfigDataBase64    string
	ConfigPathMergeList []string
	Namespace           string
}

func ParseKubernetesSynchronization added in v1.1.23

func ParseKubernetesSynchronization(address string) (*KubernetesSynchronizationParams, error)

type LocalStagesStorage added in v1.2.223

type LocalStagesStorage struct {
	ContainerBackend container_backend.ContainerBackend
}

func NewLocalStagesStorage added in v1.2.223

func NewLocalStagesStorage(containerBackend container_backend.ContainerBackend) *LocalStagesStorage

func (*LocalStagesStorage) AddManagedImage added in v1.2.223

func (storage *LocalStagesStorage) AddManagedImage(ctx context.Context, projectName, imageNameOrManagedImageName string) error

func (*LocalStagesStorage) AddStageCustomTag added in v1.2.223

func (storage *LocalStagesStorage) AddStageCustomTag(ctx context.Context, stageDescription *image.StageDescription, tag string) error

func (*LocalStagesStorage) Address added in v1.2.223

func (storage *LocalStagesStorage) Address() string

func (*LocalStagesStorage) CheckStageCustomTag added in v1.2.223

func (storage *LocalStagesStorage) CheckStageCustomTag(ctx context.Context, stageDescription *image.StageDescription, tag string) error

func (*LocalStagesStorage) ConstructStageImageName added in v1.2.223

func (storage *LocalStagesStorage) ConstructStageImageName(projectName, digest string, creationTs int64) string

func (*LocalStagesStorage) CopyFromStorage added in v1.2.225

func (storage *LocalStagesStorage) CopyFromStorage(ctx context.Context, src StagesStorage, projectName string, stageID image.StageID, opts CopyFromStorageOptions) (*image.StageDescription, error)

func (*LocalStagesStorage) CreateRepo added in v1.2.223

func (storage *LocalStagesStorage) CreateRepo(ctx context.Context) error

func (*LocalStagesStorage) DeleteRepo added in v1.2.223

func (storage *LocalStagesStorage) DeleteRepo(ctx context.Context) error

func (*LocalStagesStorage) DeleteStage added in v1.2.223

func (storage *LocalStagesStorage) DeleteStage(ctx context.Context, stageDescription *image.StageDescription, options DeleteImageOptions) error

func (*LocalStagesStorage) DeleteStageCustomTag added in v1.2.223

func (storage *LocalStagesStorage) DeleteStageCustomTag(ctx context.Context, tag string) error

func (*LocalStagesStorage) ExportStage added in v1.2.223

func (storage *LocalStagesStorage) ExportStage(ctx context.Context, stageDescription *image.StageDescription, destinationReference string, mutateConfigFunc func(config v1.Config) (v1.Config, error)) error

func (*LocalStagesStorage) FetchImage added in v1.2.223

func (*LocalStagesStorage) FilterStagesAndProcessRelatedData added in v1.2.223

func (storage *LocalStagesStorage) FilterStagesAndProcessRelatedData(ctx context.Context, stageDescriptions []*image.StageDescription, opts FilterStagesAndProcessRelatedDataOptions) ([]*image.StageDescription, error)

func (*LocalStagesStorage) GetAllAndGroupImageMetadataByImageName added in v1.2.223

func (storage *LocalStagesStorage) GetAllAndGroupImageMetadataByImageName(ctx context.Context, projectName string, imageNameOrManagedImageList []string, opts ...Option) (map[string]map[string][]string, map[string]map[string][]string, error)

func (*LocalStagesStorage) GetClientIDRecords added in v1.2.223

func (storage *LocalStagesStorage) GetClientIDRecords(ctx context.Context, projectName string, opts ...Option) ([]*ClientIDRecord, error)

func (*LocalStagesStorage) GetImportMetadata added in v1.2.223

func (storage *LocalStagesStorage) GetImportMetadata(ctx context.Context, projectName, id string) (*ImportMetadata, error)

func (*LocalStagesStorage) GetImportMetadataIDs added in v1.2.223

func (storage *LocalStagesStorage) GetImportMetadataIDs(ctx context.Context, projectName string, opts ...Option) ([]string, error)

func (*LocalStagesStorage) GetManagedImages added in v1.2.223

func (storage *LocalStagesStorage) GetManagedImages(ctx context.Context, projectName string, opts ...Option) ([]string, error)

func (*LocalStagesStorage) GetStageCustomTagMetadata added in v1.2.223

func (storage *LocalStagesStorage) GetStageCustomTagMetadata(ctx context.Context, tagOrID string) (*CustomTagMetadata, error)

func (*LocalStagesStorage) GetStageCustomTagMetadataIDs added in v1.2.223

func (storage *LocalStagesStorage) GetStageCustomTagMetadataIDs(ctx context.Context, opts ...Option) ([]string, error)

func (*LocalStagesStorage) GetStageDescription added in v1.2.223

func (storage *LocalStagesStorage) GetStageDescription(ctx context.Context, projectName string, stageID image.StageID) (*image.StageDescription, error)

func (*LocalStagesStorage) GetStagesIDs added in v1.2.223

func (storage *LocalStagesStorage) GetStagesIDs(ctx context.Context, projectName string, opts ...Option) ([]image.StageID, error)

func (*LocalStagesStorage) GetStagesIDsByDigest added in v1.2.223

func (storage *LocalStagesStorage) GetStagesIDsByDigest(ctx context.Context, projectName, digest string, parentStageCreationTs int64, _ ...Option) ([]image.StageID, error)

func (*LocalStagesStorage) IsImageMetadataExist added in v1.2.223

func (storage *LocalStagesStorage) IsImageMetadataExist(ctx context.Context, projectName, imageNameOrManagedImageName, commit, stageID string, opts ...Option) (bool, error)

func (*LocalStagesStorage) IsManagedImageExist added in v1.2.223

func (storage *LocalStagesStorage) IsManagedImageExist(ctx context.Context, projectName, imageNameOrManagedImageName string, opts ...Option) (bool, error)

func (*LocalStagesStorage) PostClientIDRecord added in v1.2.223

func (storage *LocalStagesStorage) PostClientIDRecord(ctx context.Context, projectName string, rec *ClientIDRecord) error

func (*LocalStagesStorage) PostMultiplatformImage added in v1.2.223

func (storage *LocalStagesStorage) PostMultiplatformImage(ctx context.Context, projectName, tag string, allPlatformsImages []*image.Info) error

func (*LocalStagesStorage) PutImageMetadata added in v1.2.223

func (storage *LocalStagesStorage) PutImageMetadata(ctx context.Context, projectName, imageNameOrManagedImageName, commit, stageID string) error

func (*LocalStagesStorage) PutImportMetadata added in v1.2.223

func (storage *LocalStagesStorage) PutImportMetadata(ctx context.Context, projectName string, metadata *ImportMetadata) error

func (*LocalStagesStorage) RegisterStageCustomTag added in v1.2.223

func (storage *LocalStagesStorage) RegisterStageCustomTag(ctx context.Context, projectName string, stageDescription *image.StageDescription, tag string) error

func (*LocalStagesStorage) RejectStage added in v1.2.223

func (storage *LocalStagesStorage) RejectStage(_ context.Context, _, _ string, _ int64) error

func (*LocalStagesStorage) RmImageMetadata added in v1.2.223

func (storage *LocalStagesStorage) RmImageMetadata(ctx context.Context, projectName, imageNameOrManagedImageNameOrImageMetadataID, commit, stageID string) error

func (*LocalStagesStorage) RmImportMetadata added in v1.2.223

func (storage *LocalStagesStorage) RmImportMetadata(ctx context.Context, projectName, id string) error

func (*LocalStagesStorage) RmManagedImage added in v1.2.223

func (storage *LocalStagesStorage) RmManagedImage(ctx context.Context, projectName, imageNameOrManagedImageName string) error

func (*LocalStagesStorage) ShouldFetchImage added in v1.2.223

func (storage *LocalStagesStorage) ShouldFetchImage(ctx context.Context, img container_backend.LegacyImageInterface) (bool, error)

func (*LocalStagesStorage) StoreImage added in v1.2.223

func (*LocalStagesStorage) String added in v1.2.223

func (storage *LocalStagesStorage) String() string

func (*LocalStagesStorage) UnregisterStageCustomTag added in v1.2.223

func (storage *LocalStagesStorage) UnregisterStageCustomTag(ctx context.Context, tag string) error

type LockHandle

type LockHandle struct {
	ProjectName    string              `json:"projectName"`
	LockgateHandle lockgate.LockHandle `json:"lockgateHandle"`
}

type LockManager

type LockManager interface {
	LockStage(ctx context.Context, projectName, digest string) (LockHandle, error)
	Unlock(ctx context.Context, lockHandle LockHandle) error
}

type LockStagesAndImagesOptions

type LockStagesAndImagesOptions struct {
	GetOrCreateImagesOnly bool `json:"getOrCreateImagesOnly"`
}

type Option added in v1.2.77

type Option func(*Options)

func WithCache added in v1.2.77

func WithCache() Option

type Options added in v1.2.77

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

type PrimaryStagesStorage added in v1.2.165

type PrimaryStagesStorage interface {
	StagesStorage

	GetStageCustomTagMetadataIDs(ctx context.Context, opts ...Option) ([]string, error)
	GetStageCustomTagMetadata(ctx context.Context, tagOrID string) (*CustomTagMetadata, error)
	RegisterStageCustomTag(ctx context.Context, projectName string, stageDescription *image.StageDescription, tag string) error
	UnregisterStageCustomTag(ctx context.Context, tag string) error
}

type RepoStagesStorage

type RepoStagesStorage struct {
	RepoAddress      string
	DockerRegistry   docker_registry.Interface
	ContainerBackend container_backend.ContainerBackend
}

func NewRepoStagesStorage

func NewRepoStagesStorage(repoAddress string, containerBackend container_backend.ContainerBackend, dockerRegistry docker_registry.Interface) *RepoStagesStorage

func (*RepoStagesStorage) AddManagedImage

func (storage *RepoStagesStorage) AddManagedImage(ctx context.Context, projectName, imageNameOrManagedImageName string) error

func (*RepoStagesStorage) AddStageCustomTag added in v1.2.6

func (storage *RepoStagesStorage) AddStageCustomTag(ctx context.Context, stageDescription *image.StageDescription, tag string) error

func (*RepoStagesStorage) Address

func (storage *RepoStagesStorage) Address() string

func (*RepoStagesStorage) CheckStageCustomTag added in v1.2.6

func (storage *RepoStagesStorage) CheckStageCustomTag(ctx context.Context, stageDescription *image.StageDescription, tag string) error

func (*RepoStagesStorage) ConstructStageImageName

func (storage *RepoStagesStorage) ConstructStageImageName(_, digest string, creationTs int64) string

func (*RepoStagesStorage) CopyFromStorage added in v1.2.225

func (storage *RepoStagesStorage) CopyFromStorage(ctx context.Context, src StagesStorage, projectName string, stageID image.StageID, opts CopyFromStorageOptions) (*image.StageDescription, error)

func (*RepoStagesStorage) CreateRepo

func (storage *RepoStagesStorage) CreateRepo(ctx context.Context) error

func (*RepoStagesStorage) DeleteRepo

func (storage *RepoStagesStorage) DeleteRepo(ctx context.Context) error

func (*RepoStagesStorage) DeleteStage added in v1.1.23

func (storage *RepoStagesStorage) DeleteStage(ctx context.Context, stageDescription *image.StageDescription, _ DeleteImageOptions) error

func (*RepoStagesStorage) DeleteStageCustomTag added in v1.2.28

func (storage *RepoStagesStorage) DeleteStageCustomTag(ctx context.Context, tag string) error

func (*RepoStagesStorage) ExportStage added in v1.2.15

func (storage *RepoStagesStorage) ExportStage(ctx context.Context, stageDescription *image.StageDescription, destinationReference string, mutateConfigFunc func(config v1.Config) (v1.Config, error)) error

func (*RepoStagesStorage) FetchImage

func (*RepoStagesStorage) FilterStagesAndProcessRelatedData added in v1.1.23

func (storage *RepoStagesStorage) FilterStagesAndProcessRelatedData(ctx context.Context, stageDescriptions []*image.StageDescription, options FilterStagesAndProcessRelatedDataOptions) ([]*image.StageDescription, error)

func (*RepoStagesStorage) GetAllAndGroupImageMetadataByImageName added in v1.2.0

func (storage *RepoStagesStorage) GetAllAndGroupImageMetadataByImageName(ctx context.Context, projectName string, imageNameOrManagedImageList []string, opts ...Option) (map[string]map[string][]string, map[string]map[string][]string, error)

func (*RepoStagesStorage) GetClientIDRecords added in v1.1.23

func (storage *RepoStagesStorage) GetClientIDRecords(ctx context.Context, projectName string, opts ...Option) ([]*ClientIDRecord, error)

func (*RepoStagesStorage) GetImportMetadata added in v1.2.0

func (storage *RepoStagesStorage) GetImportMetadata(ctx context.Context, _, id string) (*ImportMetadata, error)

func (*RepoStagesStorage) GetImportMetadataIDs added in v1.2.0

func (storage *RepoStagesStorage) GetImportMetadataIDs(ctx context.Context, _ string, opts ...Option) ([]string, error)

func (*RepoStagesStorage) GetManagedImages

func (storage *RepoStagesStorage) GetManagedImages(ctx context.Context, projectName string, opts ...Option) ([]string, error)

func (*RepoStagesStorage) GetStageCustomTagMetadata added in v1.2.28

func (storage *RepoStagesStorage) GetStageCustomTagMetadata(ctx context.Context, tagOrID string) (*CustomTagMetadata, error)

func (*RepoStagesStorage) GetStageCustomTagMetadataIDs added in v1.2.28

func (storage *RepoStagesStorage) GetStageCustomTagMetadataIDs(ctx context.Context, opts ...Option) ([]string, error)

func (*RepoStagesStorage) GetStageDescription

func (storage *RepoStagesStorage) GetStageDescription(ctx context.Context, projectName string, stageID image.StageID) (*image.StageDescription, error)

NOTE: Do we need a special option for multiplatform image description getter? NOTE: go-containerregistry has a special method to get an v1.ImageIndex manifest, instead of v1.Image, NOTE: should we utilize this method in GetStageDescription also? NOTE: Current version always tries to get v1.Image manifest and it works without errors though.

func (*RepoStagesStorage) GetStagesIDs added in v1.1.23

func (storage *RepoStagesStorage) GetStagesIDs(ctx context.Context, _ string, opts ...Option) ([]image.StageID, error)

func (*RepoStagesStorage) GetStagesIDsByDigest added in v1.2.0

func (storage *RepoStagesStorage) GetStagesIDsByDigest(ctx context.Context, _, digest string, parentStageCreationTs int64, opts ...Option) ([]image.StageID, error)

func (*RepoStagesStorage) IsImageMetadataExist added in v1.2.0

func (storage *RepoStagesStorage) IsImageMetadataExist(ctx context.Context, projectName, imageNameOrManagedImageName, commit, stageID string, opts ...Option) (bool, error)

func (*RepoStagesStorage) IsManagedImageExist added in v1.2.77

func (storage *RepoStagesStorage) IsManagedImageExist(ctx context.Context, _, imageNameOrManagedImageName string, opts ...Option) (bool, error)

func (*RepoStagesStorage) PostClientIDRecord added in v1.1.23

func (storage *RepoStagesStorage) PostClientIDRecord(ctx context.Context, projectName string, rec *ClientIDRecord) error

func (*RepoStagesStorage) PostMultiplatformImage added in v1.2.220

func (storage *RepoStagesStorage) PostMultiplatformImage(ctx context.Context, projectName, tag string, allPlatformsImages []*image.Info) error

func (*RepoStagesStorage) PutImageMetadata added in v1.2.0

func (storage *RepoStagesStorage) PutImageMetadata(ctx context.Context, projectName, imageNameOrManagedImageName, commit, stageID string) error

func (*RepoStagesStorage) PutImportMetadata added in v1.2.0

func (storage *RepoStagesStorage) PutImportMetadata(ctx context.Context, projectName string, metadata *ImportMetadata) error

func (*RepoStagesStorage) RegisterStageCustomTag added in v1.2.165

func (storage *RepoStagesStorage) RegisterStageCustomTag(ctx context.Context, projectName string, stageDescription *image.StageDescription, tag string) error

func (*RepoStagesStorage) RejectStage added in v1.1.24

func (storage *RepoStagesStorage) RejectStage(ctx context.Context, projectName, digest string, creationTs int64) error

func (*RepoStagesStorage) RmImageMetadata added in v1.2.0

func (storage *RepoStagesStorage) RmImageMetadata(ctx context.Context, projectName, imageNameOrManagedImageNameOrImageMetadataID, commit, stageID string) error

func (*RepoStagesStorage) RmImportMetadata added in v1.2.0

func (storage *RepoStagesStorage) RmImportMetadata(ctx context.Context, _, id string) error

func (*RepoStagesStorage) RmManagedImage

func (storage *RepoStagesStorage) RmManagedImage(ctx context.Context, projectName, imageNameOrManagedImageName string) error

func (*RepoStagesStorage) ShouldFetchImage

func (storage *RepoStagesStorage) ShouldFetchImage(ctx context.Context, img container_backend.LegacyImageInterface) (bool, error)

func (*RepoStagesStorage) StoreImage

FIXME(stapel-to-buildah): use ImageInterface instead of LegacyImageInterface FIXME(stapel-to-buildah): possible optimization would be to push buildah container directly into registry wihtout committing a local image

func (*RepoStagesStorage) String

func (storage *RepoStagesStorage) String() string

func (*RepoStagesStorage) UnregisterStageCustomTag added in v1.2.165

func (storage *RepoStagesStorage) UnregisterStageCustomTag(ctx context.Context, tag string) error

type StagesStorage

type StagesStorage interface {
	GetStagesIDs(ctx context.Context, projectName string, opts ...Option) ([]image.StageID, error)
	GetStagesIDsByDigest(ctx context.Context, projectName, digest string, parentStageCreationTs int64, opts ...Option) ([]image.StageID, error)
	GetStageDescription(ctx context.Context, projectName string, stageID image.StageID) (*image.StageDescription, error)
	ExportStage(ctx context.Context, stageDescription *image.StageDescription, destinationReference string, mutateConfigFunc func(config v1.Config) (v1.Config, error)) error
	DeleteStage(ctx context.Context, stageDescription *image.StageDescription, options DeleteImageOptions) error

	AddStageCustomTag(ctx context.Context, stageDescription *image.StageDescription, tag string) error
	CheckStageCustomTag(ctx context.Context, stageDescription *image.StageDescription, tag string) error
	DeleteStageCustomTag(ctx context.Context, tag string) error

	RejectStage(ctx context.Context, projectName, digest string, creationTs int64) error

	ConstructStageImageName(projectName, digest string, creationTs int64) string

	// FetchImage will create a local image in the container-runtime
	FetchImage(ctx context.Context, img container_backend.LegacyImageInterface) error
	// StoreImage will store a local image into the container-runtime, local built image should exist prior running store
	StoreImage(ctx context.Context, img container_backend.LegacyImageInterface) error
	ShouldFetchImage(ctx context.Context, img container_backend.LegacyImageInterface) (bool, error)
	CopyFromStorage(ctx context.Context, src StagesStorage, projectName string, stageID image.StageID, opts CopyFromStorageOptions) (*image.StageDescription, error)

	CreateRepo(ctx context.Context) error
	DeleteRepo(ctx context.Context) error

	// AddManagedImage adds managed image.
	AddManagedImage(ctx context.Context, projectName, imageNameOrManagedImageName string) error
	// RmManagedImage removes managed image by imageName or managedImageName.
	// Typically, the managedImageName is the same as the imageName, but may be different
	// if the name contains unsupported special characters, or
	// if the name exceeds the docker tag limit.
	RmManagedImage(ctx context.Context, projectName, imageNameOrManagedImageName string) error
	IsManagedImageExist(ctx context.Context, projectName, imageNameOrManagedImageName string, opts ...Option) (bool, error)
	// GetManagedImages returns the list of managedImageName.
	GetManagedImages(ctx context.Context, projectName string, opts ...Option) ([]string, error)

	PutImageMetadata(ctx context.Context, projectName, imageNameOrManagedImageName, commit, stageID string) error
	RmImageMetadata(ctx context.Context, projectName, imageNameOrManagedImageNameOrImageMetadataID, commit, stageID string) error
	IsImageMetadataExist(ctx context.Context, projectName, imageNameOrManagedImageName, commit, stageID string, opts ...Option) (bool, error)
	GetAllAndGroupImageMetadataByImageName(ctx context.Context, projectName string, imageNameOrManagedImageList []string, opts ...Option) (map[string]map[string][]string, map[string]map[string][]string, error)

	GetImportMetadata(ctx context.Context, projectName, id string) (*ImportMetadata, error)
	PutImportMetadata(ctx context.Context, projectName string, metadata *ImportMetadata) error
	RmImportMetadata(ctx context.Context, projectName, id string) error
	GetImportMetadataIDs(ctx context.Context, projectName string, opts ...Option) ([]string, error)

	GetClientIDRecords(ctx context.Context, projectName string, opts ...Option) ([]*ClientIDRecord, error)
	PostClientIDRecord(ctx context.Context, projectName string, rec *ClientIDRecord) error
	PostMultiplatformImage(ctx context.Context, projectName, tag string, allPlatformsImages []*image.Info) error
	FilterStagesAndProcessRelatedData(ctx context.Context, stageDescriptions []*image.StageDescription, options FilterStagesAndProcessRelatedDataOptions) ([]*image.StageDescription, error)

	String() string
	Address() string
}

type StagesStorageCacheRecord

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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