Documentation ¶
Index ¶
- func IsErrHTTPResponseToHTTPSClient(err error) bool
- 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) (string, 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 PullMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrHTTPResponseToHTTPSClient ¶
IsErrHTTPResponseToHTTPSClient returns whether err is "http: server gave HTTP response to HTTPS client"
func ParseRepoTag ¶ added in v0.9.0
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 the index . ReadIndex returns 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. ReadManifest returns nil if no manifest was found.
Types ¶
type EnsuredImage ¶
type EnsuredImage struct { Ref string Image containerd.Image ImageConfig ocispec.ImageConfig Snapshotter string Remote bool // true for stargz or overlaybd }
func EnsureImage ¶
func EnsureImage(ctx context.Context, client *containerd.Client, stdout, stderr io.Writer, snapshotter, rawRef string, mode PullMode, insecure bool, ocispecPlatforms []ocispec.Platform, unpack *bool, quiet bool) (*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
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. May 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) (*EnsuredImage, error)
PullImage pulls an image using the specified resolver.
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 |