registry

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFoundOrAuthError

func IsNotFoundOrAuthError(err error) bool

IsNotFoundOrAuthError checks if an error indicates that an image was not found or that authentication is required. These are expected errors when checking for DHI equivalents that may not exist.

Returns true for:

  • 404 Not Found (image doesn't exist)
  • 401 Unauthorized (authentication required)
  • 403 Forbidden (access denied)
  • "manifest unknown" errors (common registry response for missing images)

Types

type Client

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

Client provides methods for interacting with container registries

func NewClient

func NewClient() *Client

NewClient creates a new registry client It respects CONTAINERS_REGISTRIES_CONF environment variable for registry configuration

func (*Client) CheckAuth

func (c *Client) CheckAuth(ctx context.Context, registry string) error

CheckAuth verifies that the client can authenticate to a registry. It does this by attempting to access an image reference, which triggers auth. Returns nil if authentication succeeds (even if image doesn't exist), or an error describing the auth failure.

func (*Client) GetDigest

func (c *Client) GetDigest(ctx context.Context, ref reference.Named) (string, error)

GetDigest resolves an image reference to its digest

Jump to

Keyboard shortcuts

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