Documentation ¶
Overview ¶
Package remote provides facilities for reading/writing v1.Images from/to a remote image registry.
Index ¶
- Variables
- func CheckPushPermission(ref name.Reference, kc authn.Keychain, t http.RoundTripper) error
- func Delete(ref name.Reference, options ...Option) error
- func Image(ref name.Reference, options ...Option) (v1.Image, error)
- func Index(ref name.Reference, options ...Option) (v1.ImageIndex, error)
- func List(repo name.Repository, options ...Option) ([]string, error)
- func Write(ref name.Reference, img v1.Image, options ...Option) error
- func WriteIndex(ref name.Reference, ii v1.ImageIndex, options ...Option) error
- type Descriptor
- type MountableLayer
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrSchema1 = errors.New("unsupported MediaType: https://github.com/flant/go-containerregistry/issues/377")
ErrSchema1 indicates that we received a schema1 manifest from the registry. This library doesn't have plans to support this legacy image format: https://github.com/flant/go-containerregistry/issues/377
Functions ¶
func CheckPushPermission ¶
CheckPushPermission returns an error if the given keychain cannot authorize a push operation to the given ref.
This can be useful to check whether the caller has permission to push an image before doing work to construct the image.
TODO(#412): Remove the need for this method.
func List ¶
func List(repo name.Repository, options ...Option) ([]string, error)
List calls /tags/list for the given repository, returning the list of tags in the "tags" property.
func WriteIndex ¶
WriteIndex pushes the provided ImageIndex to the specified image reference. WriteIndex will attempt to push all of the referenced manifests before attempting to push the ImageIndex, to retain referential integrity.
Types ¶
type Descriptor ¶
type Descriptor struct { v1.Descriptor Manifest []byte // contains filtered or unexported fields }
Descriptor provides access to metadata about remote artifact and accessors for efficiently converting it into a v1.Image or v1.ImageIndex.
func Get ¶
func Get(ref name.Reference, options ...Option) (*Descriptor, error)
Get returns a remote.Descriptor for the given reference. The response from the registry is left un-interpreted, for the most part. This is useful for querying what kind of artifact a reference represents.
func (*Descriptor) Image ¶
func (d *Descriptor) Image() (v1.Image, error)
Image converts the Descriptor into a v1.Image.
If the fetched artifact is already an image, it will just return it.
If the fetched artifact is an index, it will attempt to resolve the index to a child image with the appropriate platform.
See WithPlatform to set the desired platform.
func (*Descriptor) ImageIndex ¶
func (d *Descriptor) ImageIndex() (v1.ImageIndex, error)
ImageIndex converts the Descriptor into a v1.ImageIndex.
type MountableLayer ¶
MountableLayer wraps a v1.Layer in a shim that enables the layer to be "mounted" when published to another registry.
type Option ¶
type Option func(*options) error
Option is a functional option for remote operations.
func WithAuth ¶
func WithAuth(auth authn.Authenticator) Option
WithAuth is a functional option for overriding the default authenticator for remote operations.
The default authenticator is authn.Anonymous.
func WithAuthFromKeychain ¶
WithAuthFromKeychain is a functional option for overriding the default authenticator for remote operations, using an authn.Keychain to find credentials.
The default authenticator is authn.Anonymous.
func WithPlatform ¶
WithPlatform is a functional option for overriding the default platform that Image and Descriptor.Image use for resolving an index to an image.
The default platform is amd64/linux.
func WithTransport ¶
func WithTransport(t http.RoundTripper) Option
WithTransport is a functional option for overriding the default transport for remote operations.
The default transport its http.DefaultTransport.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package transport provides facilities for setting up an authenticated http.RoundTripper given an Authenticator and base RoundTripper.
|
Package transport provides facilities for setting up an authenticated http.RoundTripper given an Authenticator and base RoundTripper. |