nativeconverter

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package nativeconverter provides containerd-native converter that does not depend on github.com/google/go-containerregistry. Most codes except nativeconverter/estargz will be moved to the containerd main repo later.

Index

Constants

View Source
const LabelUncompressed = "containerd.io/uncompressed"

Variables

This section is empty.

Functions

func ClearGCLabels

func ClearGCLabels(labels map[string]string, dgst digest.Digest)

func ConvertDockerMediaTypeToOCI

func ConvertDockerMediaTypeToOCI(mt string) string

func GetDiffID

func GetDiffID(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (digest.Digest, error)

GetDiffID gets the diff ID of the layer blob descriptor.

func IsConfigType

func IsConfigType(mt string) bool

func IsDockerType

func IsDockerType(mt string) bool

func IsIndexType

func IsIndexType(mt string) bool

func IsManifestType

func IsManifestType(mt string) bool

Types

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, ConvertContentFunc returns nil.

func DefaultIndexConvertFunc

func DefaultIndexConvertFunc(layerConvertFunc ConvertFunc, docker2oci bool, platformMC platforms.MatchComparer) ConvertFunc

DefaultIndexConvertFunc is the default convert func.

type ConvertOpt

type ConvertOpt func(*convertOpts) error

ConvertOpt is an option for Convert()

func WithDockerToOCI

func WithDockerToOCI(v bool) ConvertOpt

WithDockerToOCI converts Docker media types into OCI ones.

func WithIndexConvertFunc

func WithIndexConvertFunc(fn ConvertFunc) ConvertOpt

WithIndexConvertFunc specifies the function that converts manifests and index (manifest lists). Defaults to DefaultIndexConvertFunc.

func WithLayerConvertFunc

func WithLayerConvertFunc(fn ConvertFunc) ConvertOpt

WithLayerConvertFunc specifies the function that converts layers.

func WithPlatform

func WithPlatform(p platforms.MatchComparer) ConvertOpt

WithPlatform specifies the platform. Defaults to all platforms.

type Converter

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

Converter provides converter.

func New

func New(client *containerd.Client) (*Converter, error)

New creates a converter.

func (*Converter) Convert

func (conv *Converter) Convert(ctx context.Context, dstRef, srcRef string, opts ...ConvertOpt) (*images.Image, error)

Convert converts an image.

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 apper on OCI manifests and index
	MediaType string `json:"mediaType,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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