registry

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrImageNotFound = errors.New("image not found")

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides methods to interact with container registries

func NewClientWithOptions

func NewClientWithOptions(registry string, opts *ClientOptions) *Client

NewClientWithOptions creates a new container registry client with advanced options

func (*Client) CheckImageExists added in v0.21.3

func (c *Client) CheckImageExists(ctx context.Context, tag string) error

CheckImageExists checks if a specific image exists in the registry If image not found, return an error The repository is determined by the chained WithSegment() calls

func (*Client) GetDigest added in v0.20.13

func (c *Client) GetDigest(ctx context.Context, tag string) (*v1.Hash, error)

The repository is determined by the chained WithSegment() calls

func (*Client) GetImage

func (c *Client) GetImage(ctx context.Context, tag string) (pkg.RegistryImage, error)

GetImage retrieves an remote image for a specific reference Do not return remote image to avoid drop connection with context cancelation. It will be in use while passed context will be alive. The repository is determined by the chained WithSegment() calls

func (*Client) GetImageConfig

func (c *Client) GetImageConfig(ctx context.Context, tag string) (*v1.ConfigFile, error)

GetImageConfig retrieves the image config file containing labels and metadata The repository is determined by the chained WithSegment() calls

func (*Client) GetManifest

func (c *Client) GetManifest(ctx context.Context, tag string) ([]byte, error)

GetManifest retrieves the manifest for a specific image tag The repository is determined by the chained WithSegment() calls

func (*Client) GetRegistry

func (c *Client) GetRegistry() string

GetRegistry returns the full registry path (host + scope)

func (*Client) ListRepositories

func (c *Client) ListRepositories(ctx context.Context) ([]string, error)

ListRepositories lists all sub-repositories under the current scope The scope is determined by the chained WithSegment() calls Returns repository names (tags) under the current scope

func (*Client) ListTags

func (c *Client) ListTags(ctx context.Context) ([]string, error)

ListTags lists all tags for the current scope The repository is determined by the chained WithSegment() calls

func (*Client) PushImage added in v0.20.12

func (c *Client) PushImage(ctx context.Context, tag string, img pkg.RegistryImage) error

PushImage pushes an image to the registry at the specified tag The repository is determined by the chained WithSegment() calls

func (*Client) WithSegment added in v0.21.2

func (c *Client) WithSegment(segments ...string) pkg.RegistryClient

WithSegment creates a new client with an additional scope path segment This method can be chained to build complex paths: client.WithSegment("deckhouse").WithSegment("ee").WithSegment("modules")

type ClientOptions

type ClientOptions struct {
	// Auth provides authentication for registry access (takes precedence over Username/Password/LicenseToken)
	Auth authn.Authenticator

	// Username for basic authentication
	Username string

	// Password for basic authentication
	Password string

	// LicenseToken for Deckhouse license authentication (alternative to Username/Password)
	LicenseToken string

	// Insecure allows connecting to registries over HTTP instead of HTTPS
	Insecure bool

	// TLSSkipVerify skips TLS certificate verification
	TLSSkipVerify bool

	// Logger for client operations
	Logger *log.Logger
}

ClientOptions contains configuration options for the registry client

type Image added in v0.21.2

type Image struct {
	v1.Image
}

func NewImage added in v0.21.2

func NewImage(img v1.Image) *Image

func (*Image) Extract added in v0.21.2

func (i *Image) Extract() io.ReadCloser

Extract flattens the image to a single layer and returns ReadCloser for fetching the content The repository is determined by the chained WithSegment() calls

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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