Documentation ¶
Index ¶
- Variables
- func FilterByLabel(ctx context.Context, client *containerd.Client, imageList []images.Image, ...) ([]images.Image, error)
- func FilterByReference(imageList []images.Image, filters []string) ([]images.Image, error)
- func FilterDangling(imageList []images.Image, dangling bool) []images.Image
- func FilterImages(labelImages []images.Image, beforeImages []images.Image, ...) []images.Image
- func ParseRepoTag(imgName string) (string, string)
- func ReadImageConfig(ctx context.Context, img containerd.Image) (ocispec.Image, ocispec.Descriptor, error)
- func ReadIndex(ctx context.Context, img containerd.Image) (*ocispec.Index, *ocispec.Descriptor, error)
- func ReadManifest(ctx context.Context, img containerd.Image) (*ocispec.Manifest, *ocispec.Descriptor, error)
- func ResolveDigest(ctx context.Context, rawRef string, insecure bool, hostsDirs []string) (string, error)
- func UnpackedImageSize(ctx context.Context, s snapshots.Snapshotter, img containerd.Image) (int64, error)
- type EnsuredImage
- func EnsureImage(ctx context.Context, client *containerd.Client, stdout, stderr io.Writer, ...) (*EnsuredImage, error)
- func GetExistingImage(ctx context.Context, client *containerd.Client, snapshotter, rawRef string, ...) (*EnsuredImage, error)
- func PullImage(ctx context.Context, client *containerd.Client, stdout, stderr io.Writer, ...) (*EnsuredImage, error)
- type Filters
- type PullMode
- type RemoteSnapshotterFlags
Constants ¶
This section is empty.
Variables ¶
var ( FilterBeforeType = "before" FilterSinceType = "since" FilterLabelType = "label" FilterReferenceType = "reference" FilterDanglingType = "dangling" )
Filter types supported to filter images.
Functions ¶
func FilterByLabel ¶ added in v1.2.1
func FilterByLabel(ctx context.Context, client *containerd.Client, imageList []images.Image, filters map[string]string) ([]images.Image, error)
FilterByLabel filters images based on labels given in `filters`.
func FilterByReference ¶ added in v1.2.1
FilterByReference filters images using references given in `filters`.
func FilterDangling ¶ added in v1.2.1
FilterDangling filters dangling images (or keeps if `dangling` == false).
func FilterImages ¶ added in v0.23.0
func FilterImages(labelImages []images.Image, beforeImages []images.Image, sinceImages []images.Image) []images.Image
FilterImages returns images in `labelImages` that are created before MAX(beforeImages.CreatedAt) and after MIN(sinceImages.CreatedAt).
func ParseRepoTag ¶ added in v0.9.0
ParseRepoTag parses raw `imgName` to repository and tag.
func ReadImageConfig ¶ added in v0.9.0
func ReadImageConfig(ctx context.Context, img containerd.Image) (ocispec.Image, ocispec.Descriptor, error)
ReadImageConfig reads the config spec (`application/vnd.oci.image.config.v1+json`) for img.platform from content store.
func ReadIndex ¶ added in v0.13.0
func ReadIndex(ctx context.Context, img containerd.Image) (*ocispec.Index, *ocispec.Descriptor, error)
ReadIndex returns image index, or nil for non-indexed image.
func ReadManifest ¶ added in v0.13.0
func ReadManifest(ctx context.Context, img containerd.Image) (*ocispec.Manifest, *ocispec.Descriptor, error)
ReadManifest returns the manifest for img.platform, or nil if no manifest was found.
func ResolveDigest ¶ added in v0.15.0
func ResolveDigest(ctx context.Context, rawRef string, insecure bool, hostsDirs []string) (string, error)
ResolveDigest resolves `rawRef` and returns its descriptor digest.
func UnpackedImageSize ¶ added in v1.2.1
func UnpackedImageSize(ctx context.Context, s snapshots.Snapshotter, img containerd.Image) (int64, error)
UnpackedImageSize is the size of the unpacked snapshots. Does not contain the size of the blobs in the content store. (Corresponds to Docker).
Types ¶
type EnsuredImage ¶
type EnsuredImage struct { Ref string Image containerd.Image ImageConfig ocispec.ImageConfig Snapshotter string Remote bool // true for stargz or overlaybd }
EnsuredImage contains the image existed in containerd and its metadata.
func EnsureImage ¶
func EnsureImage(ctx context.Context, client *containerd.Client, stdout, stderr io.Writer, snapshotter, rawRef string, mode PullMode, insecure bool, hostsDirs []string, ocispecPlatforms []ocispec.Platform, unpack *bool, quiet bool, rFlags RemoteSnapshotterFlags) (*EnsuredImage, error)
EnsureImage ensures the image.
When insecure is set, skips verifying certs, and also falls back to HTTP when the registry does not speak HTTPS ¶
FIXME: this func has too many args
func GetExistingImage ¶ added in v0.14.0
func GetExistingImage(ctx context.Context, client *containerd.Client, snapshotter, rawRef string, platform ocispec.Platform) (*EnsuredImage, error)
GetExistingImage returns the specified image if exists in containerd. Return errdefs.NotFound() if not exists.
func PullImage ¶ added in v0.14.0
func PullImage(ctx context.Context, client *containerd.Client, stdout, stderr io.Writer, snapshotter string, resolver remotes.Resolver, ref string, ocispecPlatforms []ocispec.Platform, unpack *bool, quiet bool, rFlags RemoteSnapshotterFlags) (*EnsuredImage, error)
PullImage pulls an image using the specified resolver.
type Filters ¶ added in v1.1.0
type Filters struct { Before []string Since []string Labels map[string]string Reference []string Dangling *bool }
Filters contains all types of filters to filter images.
func ParseFilters ¶ added in v0.23.0
ParseFilters parse filter strings.
type RemoteSnapshotterFlags ¶ added in v1.7.1
type RemoteSnapshotterFlags struct {
SociIndexDigest string
}
Directories ¶
Path | Synopsis |
---|---|
Package pull forked from https://github.com/containerd/containerd/blob/v1.4.3/cmd/ctr/commands/content/fetch.go
|
Package pull forked from https://github.com/containerd/containerd/blob/v1.4.3/cmd/ctr/commands/content/fetch.go |
Package push derived from https://github.com/containerd/containerd/blob/v1.4.3/cmd/ctr/commands/images/push.go
|
Package push derived from https://github.com/containerd/containerd/blob/v1.4.3/cmd/ctr/commands/images/push.go |