Documentation ¶
Overview ¶
Package registry provides facilities for reading/writing v1.Images,Indexes from/to a remote image registry. Also exposes an implementation of the authn.Keychain interface
Index ¶
- func Keychain(keychainOpts auth.KeychainOpts, environFunc func() []string) (regauthn.Keychain, error)
- type ImagesReader
- type ImagesReaderWriter
- type Opts
- type Registry
- type SimpleRegistry
- func (r SimpleRegistry) CloneWithSingleAuth(imageRef regname.Tag) (Registry, error)
- func (r SimpleRegistry) Digest(ref regname.Reference) (regv1.Hash, error)
- func (r SimpleRegistry) FirstImageExists(digests []string) (string, error)
- func (r SimpleRegistry) Get(ref regname.Reference) (*regremote.Descriptor, error)
- func (r SimpleRegistry) Image(ref regname.Reference) (regv1.Image, error)
- func (r SimpleRegistry) Index(ref regname.Reference) (regv1.ImageIndex, error)
- func (r SimpleRegistry) ListTags(repo regname.Repository) ([]string, error)
- func (r SimpleRegistry) MultiWrite(imageOrIndexesToUpload map[regname.Reference]regremote.Taggable, ...) error
- func (r SimpleRegistry) WriteImage(ref regname.Reference, img regv1.Image) error
- func (r SimpleRegistry) WriteIndex(ref regname.Reference, idx regv1.ImageIndex) error
- func (r SimpleRegistry) WriteTag(ref regname.Tag, taggagle regremote.Taggable) error
- type WithProgress
- func (w WithProgress) CloneWithSingleAuth(imageRef regname.Tag) (Registry, error)
- func (w WithProgress) Digest(reference regname.Reference) (regv1.Hash, error)
- func (w WithProgress) FirstImageExists(digests []string) (string, error)
- func (w WithProgress) Get(reference regname.Reference) (*remote.Descriptor, error)
- func (w WithProgress) Image(reference regname.Reference) (regv1.Image, error)
- func (w WithProgress) Index(reference regname.Reference) (regv1.ImageIndex, error)
- func (w WithProgress) ListTags(repo regname.Repository) ([]string, error)
- func (w *WithProgress) MultiWrite(imageOrIndexesToUpload map[regname.Reference]remote.Taggable, concurrency int, ...) error
- func (w WithProgress) WriteImage(reference regname.Reference, image regv1.Image) error
- func (w WithProgress) WriteIndex(reference regname.Reference, index regv1.ImageIndex) error
- func (w WithProgress) WriteTag(tag regname.Tag, taggable remote.Taggable) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Keychain ¶
func Keychain(keychainOpts auth.KeychainOpts, environFunc func() []string) (regauthn.Keychain, error)
Keychain implements an authn.Keychain interface by composing multiple keychains. It enforces an order, where the keychains that contain credentials for a specific target take precedence over keychains that contain credentials for 'any' target. i.e. env keychain takes precedence over the custom keychain. Since env keychain contains credentials per HOSTNAME, and custom keychain doesn't.
Types ¶
type ImagesReader ¶ added in v0.23.0
type ImagesReader interface { Get(regname.Reference) (*regremote.Descriptor, error) Digest(regname.Reference) (regv1.Hash, error) Index(regname.Reference) (regv1.ImageIndex, error) Image(regname.Reference) (regv1.Image, error) FirstImageExists(digests []string) (string, error) }
ImagesReader Interface for Reading Images
type ImagesReaderWriter ¶ added in v0.23.0
type ImagesReaderWriter interface { ImagesReader MultiWrite(imageOrIndexesToUpload map[regname.Reference]regremote.Taggable, concurrency int, updatesCh chan regv1.Update) error WriteImage(regname.Reference, regv1.Image) error WriteIndex(regname.Reference, regv1.ImageIndex) error WriteTag(regname.Tag, regremote.Taggable) error CloneWithSingleAuth(imageRef regname.Tag) (Registry, error) }
ImagesReaderWriter Interface for Reading and Writing Images
type Registry ¶
type Registry interface { Get(reference regname.Reference) (*regremote.Descriptor, error) Digest(reference regname.Reference) (regv1.Hash, error) Index(reference regname.Reference) (regv1.ImageIndex, error) Image(reference regname.Reference) (regv1.Image, error) FirstImageExists(digests []string) (string, error) MultiWrite(imageOrIndexesToUpload map[regname.Reference]regremote.Taggable, concurrency int, updatesCh chan regv1.Update) error WriteImage(reference regname.Reference, image regv1.Image) error WriteIndex(reference regname.Reference, index regv1.ImageIndex) error WriteTag(tag regname.Tag, taggable regremote.Taggable) error ListTags(repo regname.Repository) ([]string, error) CloneWithSingleAuth(imageRef regname.Tag) (Registry, error) }
Registry Interface to access the registry
type SimpleRegistry ¶ added in v0.23.0
type SimpleRegistry struct {
// contains filtered or unexported fields
}
SimpleRegistry Implements Registry interface
func NewSimpleRegistry ¶ added in v0.23.0
func NewSimpleRegistry(opts Opts, regOpts ...regremote.Option) (*SimpleRegistry, error)
NewSimpleRegistry Builder for a Simple Registry
func (SimpleRegistry) CloneWithSingleAuth ¶ added in v0.23.0
func (r SimpleRegistry) CloneWithSingleAuth(imageRef regname.Tag) (Registry, error)
CloneWithSingleAuth Clones the provided registry replacing the Keychain with a Keychain that can only authenticate the image provided A Registry need to be provided as the first parameter or the function will panic
func (SimpleRegistry) FirstImageExists ¶ added in v0.23.0
func (r SimpleRegistry) FirstImageExists(digests []string) (string, error)
FirstImageExists Returns the first of the provided Image Digests that exists in the Registry
func (SimpleRegistry) Get ¶ added in v0.23.0
func (r SimpleRegistry) Get(ref regname.Reference) (*regremote.Descriptor, error)
Get Retrieve Image descriptor for an Image reference
func (SimpleRegistry) Image ¶ added in v0.23.0
Image Retrieve the regv1.Image struct for an Image reference
func (SimpleRegistry) Index ¶ added in v0.23.0
func (r SimpleRegistry) Index(ref regname.Reference) (regv1.ImageIndex, error)
Index Retrieve regv1.ImageIndex struct for an Index reference
func (SimpleRegistry) ListTags ¶ added in v0.23.0
func (r SimpleRegistry) ListTags(repo regname.Repository) ([]string, error)
ListTags Retrieve all tags associated with a Repository
func (SimpleRegistry) MultiWrite ¶ added in v0.23.0
func (r SimpleRegistry) MultiWrite(imageOrIndexesToUpload map[regname.Reference]regremote.Taggable, concurrency int, updatesCh chan regv1.Update) error
MultiWrite Upload multiple Images in Parallel to the Registry
func (SimpleRegistry) WriteImage ¶ added in v0.23.0
WriteImage Upload Image to registry
func (SimpleRegistry) WriteIndex ¶ added in v0.23.0
func (r SimpleRegistry) WriteIndex(ref regname.Reference, idx regv1.ImageIndex) error
WriteIndex Uploads the Index manifest to the registry
type WithProgress ¶
type WithProgress struct {
// contains filtered or unexported fields
}
func NewRegistryWithProgress ¶
func NewRegistryWithProgress(reg Registry, logger util.ProgressLogger) *WithProgress
func (WithProgress) CloneWithSingleAuth ¶ added in v0.23.0
func (w WithProgress) CloneWithSingleAuth(imageRef regname.Tag) (Registry, error)
CloneWithSingleAuth Clones the provided registry replacing the Keychain with a Keychain that can only authenticate the image provided A Registry need to be provided as the first parameter or the function will panic
func (WithProgress) FirstImageExists ¶
func (w WithProgress) FirstImageExists(digests []string) (string, error)
func (WithProgress) Get ¶
func (w WithProgress) Get(reference regname.Reference) (*remote.Descriptor, error)
func (WithProgress) Index ¶
func (w WithProgress) Index(reference regname.Reference) (regv1.ImageIndex, error)
func (WithProgress) ListTags ¶ added in v0.23.0
func (w WithProgress) ListTags(repo regname.Repository) ([]string, error)
ListTags Retrieve all tags associated with a Repository
func (*WithProgress) MultiWrite ¶
func (WithProgress) WriteImage ¶
func (WithProgress) WriteIndex ¶
func (w WithProgress) WriteIndex(reference regname.Reference, index regv1.ImageIndex) error