layer

package
v0.20.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	RetrieveLayer(sha string) (io.ReadCloser, error)
}

type DefaultMetadataRestorer

type DefaultMetadataRestorer struct {
	LayersDir   string
	SkipLayers  bool
	Logger      log.Logger
	PlatformAPI *api.Version
}

func NewDefaultMetadataRestorer added in v0.14.1

func NewDefaultMetadataRestorer(layersDir string, skipLayers bool, logger log.Logger, platformAPI *api.Version) *DefaultMetadataRestorer

NewDefaultMetadataRestorer returns an instance of the DefaultMetadataRestorer struct

func (*DefaultMetadataRestorer) Restore

func (r *DefaultMetadataRestorer) Restore(buildpacks []buildpack.GroupElement, appMeta files.LayersMetadata, cacheMeta platform.CacheMetadata, layerSHAStore SHAStore) error

type DefaultSBOMRestorer

type DefaultSBOMRestorer struct {
	LayersDir string
	Logger    log.Logger
}

func (*DefaultSBOMRestorer) RestoreFromCache

func (r *DefaultSBOMRestorer) RestoreFromCache(cache Cache, layerDigest string) error

func (*DefaultSBOMRestorer) RestoreFromPrevious

func (r *DefaultSBOMRestorer) RestoreFromPrevious(image imgutil.Image, layerDigest string) error

func (*DefaultSBOMRestorer) RestoreToBuildpackLayers

func (r *DefaultSBOMRestorer) RestoreToBuildpackLayers(detectedBps []buildpack.GroupElement) error

type MetadataRestorer

type MetadataRestorer interface {
	Restore(buildpacks []buildpack.GroupElement, appMeta files.LayersMetadata, cacheMeta platform.CacheMetadata, layerSHAStore SHAStore) error
}

MetadataRestorer given a group of buildpacks and metadata from the previous image and cache, will create `<layers>/<buildpack-id>/<layer>.toml` files containing `metadata` that the buildpack previously wrote. Note that layer `types` information is not persisted, as the buildpack must opt in to layer re-use by editing the provided `<layer>.toml` to configure the desired layer type.

type NopMetadataRestorer added in v0.14.1

type NopMetadataRestorer struct{}

func (*NopMetadataRestorer) Restore added in v0.14.1

type NopSBOMRestorer added in v0.14.0

type NopSBOMRestorer struct{}

func (*NopSBOMRestorer) RestoreFromCache added in v0.14.0

func (r *NopSBOMRestorer) RestoreFromCache(_ Cache, _ string) error

func (*NopSBOMRestorer) RestoreFromPrevious added in v0.14.0

func (r *NopSBOMRestorer) RestoreFromPrevious(_ imgutil.Image, _ string) error

func (*NopSBOMRestorer) RestoreToBuildpackLayers added in v0.14.0

func (r *NopSBOMRestorer) RestoreToBuildpackLayers(_ []buildpack.GroupElement) error

type SBOMRestorer

type SBOMRestorer interface {
	RestoreFromPrevious(image imgutil.Image, layerDigest string) error
	RestoreFromCache(cache Cache, layerDigest string) error
	RestoreToBuildpackLayers(detectedBps []buildpack.GroupElement) error
}

SBOMRestorer handles the restoration of SBOM layer data. Given a previous image or cache, it will extract the SBOM layer to the local filesystem. Given a group of buildpacks and a `<layers>/sbom/<cache|launch>` directory, it will copy the relevant SBOM files to `<layers>/<buildpack-id>/ so that they can be used in the current build.

func NewSBOMRestorer

func NewSBOMRestorer(opts SBOMRestorerOpts, platformAPI *api.Version) SBOMRestorer

type SBOMRestorerOpts added in v0.14.0

type SBOMRestorerOpts struct {
	LayersDir string
	Logger    log.Logger
	Nop       bool
}

type SHAStore

type SHAStore interface {
	Get(buildpackID string, layer buildpack.Layer) (string, error)
	// contains filtered or unexported methods
}

func NewSHAStore

func NewSHAStore() SHAStore

NewSHAStore returns a new SHAStore for mapping buildpack IDs to layer names and their SHAs.

Jump to

Keyboard shortcuts

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