registry

package
v1.0.0-dev Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package registry defines a Registry interface and client for working for imkpkg images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRegistryTrustedRootCertsFileForWindows added in v0.90.0

func AddRegistryTrustedRootCertsFileForWindows(registryCertOpts *RegistryCertOptions) error

AddRegistryTrustedRootCertsFileForWindows adds CA certificate to registry options for Windows environments

func GetRegistryName added in v0.90.0

func GetRegistryName(imageName string) (string, error)

GetRegistryName extracts the registry name from the image name with/without image tag (e.g. localhost:9876/tanzu-cli/plugins/central:small => localhost:9876)

Types

type Registry

type Registry interface {
	// ListImageTags lists all tags of the given image.
	ListImageTags(imageName string) ([]string, error)
	// GetFile gets the file content bundled in the given image:tag.
	// If filename is empty, it will get the first file.
	GetFile(imageWithTag string, filename string) ([]byte, error)
	// GetFiles get all the files content bundled in the given image:tag.
	GetFiles(imageWithTag string) (map[string][]byte, error)
	// DownloadBundle downloads OCI bundle similar to `imgpkg pull -b` command
	// It is recommended to use this function when downloading imgpkg bundle
	DownloadBundle(imageName, outputDir string) error
	// DownloadImage downloads an OCI image similarly to the `imgpkg pull -i` command
	DownloadImage(imageName, outputDir string) error
	// GetImageDigest gets the digest of an OCI image similar to the `imgpkg tag resolve -i` command
	GetImageDigest(imageWithTag string) (string, string, error)
	// CopyImageToTar downloads the image as tar file
	// This is equivalent to `imgpkg copy --image <image> --to-tar <tar-file-path>` command
	CopyImageToTar(sourceImageName, destTarFile string) error
	// CopyImageFromTar publishes the image to destination repository from specified tar file
	// This is equivalent to `imgpkg copy --tar <file> --to-repo <dest-repo>` command
	CopyImageFromTar(sourceTarFile, destImageRepo string) error
	// PushImage publishes the image to the specified location
	// This is equivalent to `imgpkg push -i <image> -f <filepath>`
	PushImage(imageWithTag string, filePaths []string) error
}

Registry defines the Registry interface

func New

func New(opts *ctlimg.Opts) (Registry, error)

New instantiates a new Registry

type RegistryCertOptions

type RegistryCertOptions struct {
	CACertPaths    []string
	SkipCertVerify bool
	Insecure       bool
}

func GetRegistryCertOptions added in v0.90.0

func GetRegistryCertOptions(registryHost string) (*RegistryCertOptions, error)

Jump to

Keyboard shortcuts

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