Documentation ¶
Index ¶
- Constants
- Variables
- func AcquireToken(ctx context.Context, name string) error
- func BaseDir(ctx context.Context) string
- func Cache(ctx context.Context) cache.Cache
- func Client(ctx context.Context) *client.Client
- func L(ctx context.Context) hclog.Logger
- func ReleaseToken(ctx context.Context)
- type BuildConfig
- type CombinableSpec
- type CombinedSpec
- type FileLayerSpec
- type ImportOCISpec
- type ImportSpec
- type Spec
Constants ¶
const ( MediaTypeImageIndexDockerVendor = "application/vnd.docker.distribution.manifest.list.v2+json" MediaTypeConfigDockerVendor = "application/vnd.docker.container.image.v1+json" )
const DefaultParallelWorkers = 2
DefaultParallelWorkers is the number of jobs to execute in parallel if no override in the BuildConfig has been set.
const LayerID = "layerID"
Variables ¶
var ( ErrReferenceNotByDigest = errors.New("reference not by digest") ErrCorruptImportedImage = errors.New("corrupt import image") ErrNoCompatibleImage = errors.New("no compatible image found") )
var ErrUninterpretableValue = errors.New("unable to interpret value")
Functions ¶
func AcquireToken ¶
AcquireToken blocks until a slot from the contexts semaphore is reserved. The semaphore is initialized with the ParallelWorkers setting in the BuildConfig. The given name is used to enrich the logs.
func BaseDir ¶
BaseDir extracts the directory serving as base for all relative path calculations from the given context. It panics if there is no base dir set.
func Cache ¶
Cache extracts the Cache instance from the given context. If there is no Cache stored in the context, it panics.
func Client ¶
Client extracts the Client pointer from the given context. If there is no Client stored in the context, it panics.
func L ¶
L extracts the hclog.Logger from the given context. It wraps hclog.FromContext to provide a consistent interface.
func ReleaseToken ¶
ReleaseToken releases a slot reserved by AcquireToken. It is an error to release a token that was never acquired (this is not enforced by this method).
Types ¶
type BuildConfig ¶
type BuildConfig struct { Client *client.Client Cache cache.Cache BaseDir string ParallelWorkers int TagPrefix string }
func (BuildConfig) BuildV1 ¶
func (bc BuildConfig) BuildV1(ctx context.Context, conf configv1.SingleImageConfigFile) (client.ManifestRef, error)
type CombinableSpec ¶
type CombinedSpec ¶
type CombinedSpec []CombinableSpec
CombinedSpec 'flattens' multiple combinable specs into one layer. For example, this allows to copy a set of files in a shared layer.
func (CombinedSpec) EnsureInCache ¶
func (cs CombinedSpec) EnsureInCache(bc context.Context) ([]imagev1.Descriptor, error)
EnsureInCache calls all subspecs in turn and stores the resulting layer in the cache.
type FileLayerSpec ¶
func NewFileLayerSpecV1 ¶
func NewFileLayerSpecV1(flsc v1config.FileLayerSpec) (FileLayerSpec, error)
func (FileLayerSpec) EnsureInCache ¶
func (fls FileLayerSpec) EnsureInCache(ctx context.Context) ([]imagev1.Descriptor, error)
func (FileLayerSpec) ProvideAsTarEntries ¶
type ImportOCISpec ¶
type ImportOCISpec struct {
Ref client.ManifestRef
}
func (ImportOCISpec) EnsureInCache ¶
func (ios ImportOCISpec) EnsureInCache(ctx context.Context) ([]imagev1.Descriptor, error)
type ImportSpec ¶
type ImportSpec struct {
Path string
}
func (ImportSpec) EnsureInCache ¶
func (is ImportSpec) EnsureInCache(ctx context.Context) ([]imagev1.Descriptor, error)
type Spec ¶
type Spec interface {
EnsureInCache(context.Context) ([]imagev1.Descriptor, error)
}
func NewImportOCISpecV1 ¶
func NewImportSpecV1 ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
pkg
|
|
client
Package client provides a just-enough-features client for an OCI registry (https://github.com/opencontainers/distribution-spec/blob/master/spec.md).
|
Package client provides a just-enough-features client for an OCI registry (https://github.com/opencontainers/distribution-spec/blob/master/spec.md). |
config
Package config provides functions to read spec files in all supported versions.
|
Package config provides functions to read spec files in all supported versions. |