Package converter provides image converter



    This section is empty.


    This section is empty.


    func ClearGCLabels

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

      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

        func ConvertDockerMediaTypeToOCI(mt string) string

          ConvertDockerMediaTypeToOCI converts a media type string


          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 {

                    DualIndex covers Docker manifest list and OCI index

                    type DualManifest

                    type DualManifest struct {

                      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

                          func WithDockerToOCI(v bool) Opt

                            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.


                                  Path Synopsis