Documentation ¶
Overview ¶
Package converter provides image converter
Index ¶
- func ClearGCLabels(labels map[string]string, dgst digest.Digest)
- func Convert(ctx context.Context, client Client, dstRef, srcRef string, opts ...Opt) (*images.Image, error)
- func ConvertDockerMediaTypeToOCI(mt string) string
- type Client
- type ConvertFunc
- type DualConfig
- type DualIndex
- type DualManifest
- type ObjectWithMediaType
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearGCLabels ¶
ClearGCLabels clears GC labels for the given digest.
func Convert ¶
func Convert(ctx context.Context, client Client, dstRef, srcRef string, opts ...Opt) (*images.Image, error)
Convert converts an image.
func ConvertDockerMediaTypeToOCI ¶
ConvertDockerMediaTypeToOCI converts a media type string
Types ¶
type Client ¶
type Client interface { WithLease(ctx context.Context, opts ...leases.Opt) (context.Context, func(context.Context) error, error) ContentStore() content.Store ImageService() images.Store }
Client is implemented by *containerd.Client .
type ConvertFunc ¶
type ConvertFunc func(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error)
ConvertFunc returns a converted content descriptor. When the content was not converted, ConvertFunc returns nil.
func DefaultIndexConvertFunc ¶
func DefaultIndexConvertFunc(layerConvertFunc ConvertFunc, docker2oci bool, platformMC platforms.MatchComparer) ConvertFunc
DefaultIndexConvertFunc is the default convert func used by Convert.
type DualConfig ¶
type DualConfig map[string]*json.RawMessage
DualConfig covers Docker config (v1.0, v1.1, v1.2) and OCI config. Unmarshalled as map[string]*json.RawMessage to retain unknown fields on remarshalling.
type DualIndex ¶
type DualIndex struct { ocispec.Index ObjectWithMediaType }
DualIndex covers Docker manifest list and OCI index
type DualManifest ¶
type DualManifest struct { ocispec.Manifest ObjectWithMediaType }
DualManifest covers Docker manifest and OCI manifest
type ObjectWithMediaType ¶
type ObjectWithMediaType struct { // MediaType appears on Docker manifests and manifest lists. // MediaType does not appear on OCI manifests and index MediaType string `json:"mediaType,omitempty"` }
ObjectWithMediaType represents an object with a MediaType field
type Opt ¶
type Opt func(*convertOpts) error
Opt is an option for Convert()
func WithDockerToOCI ¶
WithDockerToOCI converts Docker media types into OCI ones.
func WithIndexConvertFunc ¶
func WithIndexConvertFunc(fn ConvertFunc) Opt
WithIndexConvertFunc specifies the function that converts manifests and index (manifest lists). Defaults to DefaultIndexConvertFunc.
func WithLayerConvertFunc ¶
func WithLayerConvertFunc(fn ConvertFunc) Opt
WithLayerConvertFunc specifies the function that converts layers.
func WithPlatform ¶
func WithPlatform(p platforms.MatchComparer) Opt
WithPlatform specifies the platform. Defaults to all platforms.