registry

package
v0.23.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

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

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 Opts

type Opts struct {
	CACertPaths []string
	VerifyCerts bool
	Insecure    bool

	IncludeNonDistributableLayers bool

	Username string
	Password string
	Token    string
	Anon     bool

	ResponseHeaderTimeout time.Duration

	EnvironFunc func() []string
}

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) Digest added in v0.23.0

func (r SimpleRegistry) Digest(ref regname.Reference) (regv1.Hash, error)

Digest Retrieve the Digest for an Image reference

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

Get Retrieve Image descriptor for an Image reference

func (SimpleRegistry) Image added in v0.23.0

func (r SimpleRegistry) Image(ref regname.Reference) (regv1.Image, error)

Image Retrieve the regv1.Image struct for an Image reference

func (SimpleRegistry) Index added in v0.23.0

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

func (r SimpleRegistry) WriteImage(ref regname.Reference, img regv1.Image) error

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

func (SimpleRegistry) WriteTag added in v0.23.0

func (r SimpleRegistry) WriteTag(ref regname.Tag, taggagle regremote.Taggable) error

WriteTag Tag the referenced Image

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) Digest

func (w WithProgress) Digest(reference regname.Reference) (regv1.Hash, error)

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) Image

func (w WithProgress) Image(reference regname.Reference) (regv1.Image, 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 (w *WithProgress) MultiWrite(imageOrIndexesToUpload map[regname.Reference]remote.Taggable, concurrency int, _ chan regv1.Update) error

func (WithProgress) WriteImage

func (w WithProgress) WriteImage(reference regname.Reference, image regv1.Image) error

func (WithProgress) WriteIndex

func (w WithProgress) WriteIndex(reference regname.Reference, index regv1.ImageIndex) error

func (WithProgress) WriteTag

func (w WithProgress) WriteTag(tag regname.Tag, taggable remote.Taggable) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL