Documentation
¶
Overview ¶
Package oci provides shared helpers for authenticating to OCI registries.
Index ¶
- Variables
- func GHCRAuth(atmosConfig *schema.AtmosConfiguration) (authn.Authenticator, string)
- func ProcessImage(ctx context.Context, atmosConfig *schema.AtmosConfiguration, imageName string, ...) error
- func WithRetryObserver(ctx context.Context, observer func(int)) context.Context
- type ResolvedImage
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidFilePath = errors.New("invalid file path")
var ErrNoLayers = errors.New("the OCI image does not have any layers")
Functions ¶
func GHCRAuth ¶
func GHCRAuth(atmosConfig *schema.AtmosConfiguration) (authn.Authenticator, string)
GHCRAuth returns authentication credentials for GitHub Container Registry (ghcr.io) derived from Atmos settings, along with a human-readable source description. It returns (nil, "") when no usable credentials are configured so callers can fall back to anonymous access or the default keychain.
func ProcessImage ¶
func ProcessImage(ctx context.Context, atmosConfig *schema.AtmosConfiguration, imageName string, destDir string) error
ProcessImage pulls an OCI image and extracts its layers to the specified destination directory. The context bounds the pull (registry auth plus manifest/layer fetch) -- callers should pass one with a deadline, matching the timeout the go-getter download path already enforces.
func WithRetryObserver ¶
WithRetryObserver routes retry notices to the caller and suppresses terminal diagnostics during this operation. Errors are still returned to the caller. The observer is scoped to this context, including provenance resolution.
Types ¶
type ResolvedImage ¶ added in v1.225.0
ResolvedImage is the immutable registry identity selected for an OCI source. Digest is the descriptor digest for the selected manifest; it is suitable for locks and SBOM provenance, unlike the mutable declared tag/reference.
func ResolveImage ¶ added in v1.225.0
func ResolveImage(ctx context.Context, atmosConfig *schema.AtmosConfiguration, imageName string) (*ResolvedImage, error)
ResolveImage authenticates and resolves an OCI reference without extracting layers. It is the public provenance boundary for OCI consumers.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ocitest provides an in-process OCI registry for tests, so tests never depend on real network access or a real container registry.
|
Package ocitest provides an in-process OCI registry for tests, so tests never depend on real network access or a real container registry. |