image

package
v2.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvToMap

func EnvToMap(env []string) map[string]string

func ImageLogProcessStyle

func ImageLogProcessStyle(isArtifact bool) color.Style

func ImageLogTagStyle

func ImageLogTagStyle(isArtifact bool) color.Style

Types

type BaseImageType

type BaseImageType string
const (
	ImageFromRegistryAsBaseImage BaseImageType = "ImageFromRegistryAsBaseImage"
	StageAsBaseImage             BaseImageType = "StageAsBaseImage"
	NoBaseImage                  BaseImageType = "NoBaseImage"
)

type BuildContextArchive

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

func NewBuildContextArchive

func NewBuildContextArchive(giterminismMgr giterminism_manager.Interface, extractionRootTmpDir string) *BuildContextArchive

func (*BuildContextArchive) CalculateGlobsChecksum

func (a *BuildContextArchive) CalculateGlobsChecksum(ctx context.Context, globs []string, checkForArchives bool) (string, error)

func (*BuildContextArchive) CalculatePathsChecksum

func (a *BuildContextArchive) CalculatePathsChecksum(ctx context.Context, paths []string) (string, error)

func (*BuildContextArchive) CleanupExtractedDir

func (a *BuildContextArchive) CleanupExtractedDir(ctx context.Context)

func (*BuildContextArchive) Create

func (*BuildContextArchive) ExtractOrGetExtractedDir

func (a *BuildContextArchive) ExtractOrGetExtractedDir(ctx context.Context) (string, error)

func (*BuildContextArchive) Path

func (a *BuildContextArchive) Path() string

type CommonImageOptions

type CommonImageOptions struct {
	Conveyor           Conveyor
	GiterminismManager giterminism_manager.Interface
	ContainerBackend   container_backend.ContainerBackend
	StorageManager     manager.StorageManagerInterface
	ProjectDir         string
	ProjectName        string
	ContainerWerfDir   string
	TmpDir             string

	ForceTargetPlatformLogging bool
}

type Conveyor

type Conveyor interface {
	stage.Conveyor

	GetImage(targetPlatform, name string) *Image
	GetOrCreateStageImage(name string, prevStageImage *stage.StageImage, stg stage.Interface, img *Image) *stage.StageImage

	GetForcedTargetPlatforms() []string
	GetTargetPlatforms() ([]string, error)
	GetImageTargetPlatforms(imageName string) ([]string, error)

	IsBaseImagesRepoIdsCacheExist(key string) bool
	GetBaseImagesRepoIdsCache(key string) string
	SetBaseImagesRepoIdsCache(key, value string)

	IsBaseImagesRepoErrCacheExist(key string) bool
	GetBaseImagesRepoErrCache(key string) error
	SetBaseImagesRepoErrCache(key string, err error)

	GetServiceRWMutex(service string) *sync.RWMutex

	SetRemoteGitRepo(key string, repo *git_repo.Remote)
	GetRemoteGitRepo(key string) *git_repo.Remote
}

type Image

type Image struct {
	CommonImageOptions

	IsArtifact              bool
	IsDockerfileImage       bool
	IsDockerfileTargetStage bool
	Name                    string
	DockerfileImageConfig   *config.ImageFromDockerfile
	TargetPlatform          string
	// contains filtered or unexported fields
}

func NewImage

func NewImage(ctx context.Context, targetPlatform, name string, baseImageType BaseImageType, opts ImageOptions) (*Image, error)

func (*Image) ExpandDependencies

func (i *Image) ExpandDependencies(ctx context.Context, baseEnv map[string]string) error

func (*Image) FetchBaseImage

func (i *Image) FetchBaseImage(ctx context.Context) error

func (*Image) GetBaseImageReference

func (i *Image) GetBaseImageReference() string

func (*Image) GetBaseImageRepoDigest

func (i *Image) GetBaseImageRepoDigest() string

func (*Image) GetBaseStageImage

func (i *Image) GetBaseStageImage() *stage.StageImage

TODO(staged-dockerfile): this is only for compatibility with stapel-builder logic, and this should be unified with new staged-dockerfile logic

func (*Image) GetContentDigest

func (i *Image) GetContentDigest() string

func (*Image) GetLastNonEmptyStage

func (i *Image) GetLastNonEmptyStage() stage.Interface

func (*Image) GetLogName

func (i *Image) GetLogName() string

func (*Image) GetName

func (i *Image) GetName() string

func (*Image) GetRebuilt

func (i *Image) GetRebuilt() bool

func (*Image) GetStage

func (i *Image) GetStage(name stage.StageName) stage.Interface

func (*Image) GetStageID

func (i *Image) GetStageID() string

func (*Image) GetStages

func (i *Image) GetStages() []stage.Interface

func (*Image) IsBasedOnStage added in v2.5.0

func (i *Image) IsBasedOnStage() bool

func (*Image) IsFinal

func (i *Image) IsFinal() bool

func (*Image) LogDetailedName

func (i *Image) LogDetailedName() string

func (*Image) LogName

func (i *Image) LogName() string

func (*Image) LogProcessStyle

func (i *Image) LogProcessStyle() color.Style

func (*Image) LogTagStyle

func (i *Image) LogTagStyle() color.Style

func (*Image) SetContentDigest

func (i *Image) SetContentDigest(digest string)

func (*Image) SetLastNonEmptyStage

func (i *Image) SetLastNonEmptyStage(stg stage.Interface)

func (*Image) SetRebuilt

func (i *Image) SetRebuilt(rebuilt bool)

func (*Image) SetStages

func (i *Image) SetStages(stages []stage.Interface)

func (*Image) SetupBaseImage

func (i *Image) SetupBaseImage(ctx context.Context, storageManager manager.StorageManagerInterface, storageOpts manager.StorageOptions) error

func (*Image) ShouldLogPlatform

func (i *Image) ShouldLogPlatform() bool

func (*Image) UsesBuildContext

func (i *Image) UsesBuildContext() bool

type ImageOptions

type ImageOptions struct {
	CommonImageOptions
	IsArtifact, IsDockerfileImage, IsDockerfileTargetStage bool
	DockerfileImageConfig                                  *config.ImageFromDockerfile

	BaseImageReference        string
	BaseImageName             string
	FetchLatestBaseImage      bool
	DockerfileExpanderFactory dockerfile.ExpanderFactory
}

type ImagesSets

type ImagesSets [][]*Image

func MapDockerfileConfigToImagesSets

func MapDockerfileConfigToImagesSets(ctx context.Context, dockerfileImageConfig *config.ImageFromDockerfile, targetPlatform string, opts CommonImageOptions) (ImagesSets, error)

func MapStapelConfigToImagesSets

func MapStapelConfigToImagesSets(ctx context.Context, metaConfig *config.Meta, stapelImageConfig config.StapelImageInterface, targetPlatform string, opts CommonImageOptions) (ImagesSets, error)

type ImagesSetsBuilder

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

func NewImagesSetsBuilder

func NewImagesSetsBuilder() *ImagesSetsBuilder

func (*ImagesSetsBuilder) GetAllImages

func (is *ImagesSetsBuilder) GetAllImages() []*Image

func (*ImagesSetsBuilder) GetImagesSets

func (is *ImagesSetsBuilder) GetImagesSets() ImagesSets

func (*ImagesSetsBuilder) MergeImagesSets

func (is *ImagesSetsBuilder) MergeImagesSets(newImagesSets [][]*Image)

func (*ImagesSetsBuilder) Next

func (is *ImagesSetsBuilder) Next()

type ImagesTree

type ImagesTree struct {
	ImagesTreeOptions
	// contains filtered or unexported fields
}

func NewImagesTree

func NewImagesTree(werfConfig *config.WerfConfig, opts ImagesTreeOptions) *ImagesTree

func (*ImagesTree) Calculate

func (tree *ImagesTree) Calculate(ctx context.Context) error

func (*ImagesTree) GetImage

func (tree *ImagesTree) GetImage(name string) *Image

func (*ImagesTree) GetImagePlatformsByName

func (tree *ImagesTree) GetImagePlatformsByName(finalOnly bool) map[string][]string

func (*ImagesTree) GetImages

func (tree *ImagesTree) GetImages() []*Image

func (*ImagesTree) GetImagesByName

func (tree *ImagesTree) GetImagesByName(finalOnly bool) []util.Pair[string, []*Image]

func (*ImagesTree) GetImagesNames

func (tree *ImagesTree) GetImagesNames() (res []string)

func (*ImagesTree) GetImagesSets

func (tree *ImagesTree) GetImagesSets() ImagesSets

func (*ImagesTree) GetMultiplatformImage

func (tree *ImagesTree) GetMultiplatformImage(name string) *MultiplatformImage

func (*ImagesTree) GetMultiplatformImages

func (tree *ImagesTree) GetMultiplatformImages() []*MultiplatformImage

func (*ImagesTree) SetMultiplatformImage

func (tree *ImagesTree) SetMultiplatformImage(newImg *MultiplatformImage)

type ImagesTreeOptions

type ImagesTreeOptions struct {
	CommonImageOptions

	OnlyImages    []string
	WithoutImages bool
}

type MultiplatformImage

type MultiplatformImage struct {
	Name   string
	Images []*Image

	MultiplatformImageOptions
	// contains filtered or unexported fields
}

func NewMultiplatformImage

func NewMultiplatformImage(name string, images []*Image, storageManager manager.StorageManagerInterface, opts MultiplatformImageOptions) *MultiplatformImage

func (*MultiplatformImage) GetDigest

func (img *MultiplatformImage) GetDigest() string

func (*MultiplatformImage) GetFinalStageDescription

func (img *MultiplatformImage) GetFinalStageDescription() *image.StageDescription

func (*MultiplatformImage) GetImagesInfoList

func (img *MultiplatformImage) GetImagesInfoList() []*common_image.Info

func (*MultiplatformImage) GetPlatforms

func (img *MultiplatformImage) GetPlatforms() []string

func (*MultiplatformImage) GetStageDescription

func (img *MultiplatformImage) GetStageDescription() *image.StageDescription

func (*MultiplatformImage) GetStageID

func (img *MultiplatformImage) GetStageID() common_image.StageID

func (*MultiplatformImage) IsFinal

func (img *MultiplatformImage) IsFinal() bool

func (*MultiplatformImage) SetFinalStageDescription

func (img *MultiplatformImage) SetFinalStageDescription(desc *common_image.StageDescription)

func (*MultiplatformImage) SetStageDescription

func (img *MultiplatformImage) SetStageDescription(desc *common_image.StageDescription)

type MultiplatformImageOptions

type MultiplatformImageOptions struct {
	IsArtifact, IsDockerfileImage, IsDockerfileTargetStage bool
}

Jump to

Keyboard shortcuts

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