Documentation
¶
Index ¶
- Variables
- func BuildOciRepoRef(ctx context.Context, ociSpec *domain.OciRepoSpec, ref string) (*remote.Repository, error)
- func BuildOciTLSConfig(ociSpec *domain.OciRepoSpec) (*tls.Config, error)
- func CachedImageDigest(ctx context.Context, logger logrus.FieldLogger, cache DigestCache, ...) (string, error)
- func DeviceImagePlatform(device *domain.Device) *ocispec.Platform
- func DigestFromImageRef(imageRef string) (string, error)
- func ImageDestRef(registry, imageName, imageTag string) string
- func InspectImageDigest(ctx context.Context, image string, spec *domain.OciRepoSpec) (string, error)
- func InspectImagePayloadSize(ctx context.Context, imageRef, targetDigest string, spec *domain.OciRepoSpec, ...) (*int64, error)
- func RegistryObjectRef(spec *domain.OciRepoSpec, imageName string) (string, error)
- func RemoteRepository(ctx context.Context, spec *domain.OciRepoSpec, imageRef string) (*remote.Repository, string, error)
- func RepoDestRef(registry, imageName string) string
- func ResolveDeltaPushPath(spec *domain.OciRepoSpec, imageRepository string) (string, error)
- func RewriteImageRef(image string) (string, error)
- func SpecForRegistry(host string, spec *domain.OciRepoSpec) *domain.OciRepoSpec
- type DigestCache
- type ImageDigestPair
Constants ¶
This section is empty.
Variables ¶
var ErrSourceDigestUnresolved = errors.New("source image digest cannot be resolved")
ErrSourceDigestUnresolved marks failures while resolving or inspecting the source digest, allowing delta preparation to skip only that device.
Functions ¶
func BuildOciRepoRef ¶
func BuildOciRepoRef(ctx context.Context, ociSpec *domain.OciRepoSpec, ref string) (*remote.Repository, error)
BuildOciRepoRef creates a fully configured ORAS remote.Repository from an OciRepoSpec and a full reference string (e.g. "registry.example.com/my-image"). It sets up TLS, credentials, and HTTP scheme based on the spec. Callers that push artifacts should also set repoRef.SkipReferrersGC = true.
func BuildOciTLSConfig ¶
func BuildOciTLSConfig(ociSpec *domain.OciRepoSpec) (*tls.Config, error)
BuildOciTLSConfig builds a *tls.Config from an OciRepoSpec, applying InsecureSkipVerify and custom CA certificates as configured.
func CachedImageDigest ¶ added in v1.4.0
func DeviceImagePlatform ¶ added in v1.4.0
DeviceImagePlatform returns the OS and architecture reported by a device. A missing status or incomplete platform is represented by nil so callers can use their existing single-manifest fallback behavior.
func DigestFromImageRef ¶ added in v1.4.0
func ImageDestRef ¶ added in v1.4.0
func InspectImageDigest ¶ added in v1.4.0
func InspectImagePayloadSize ¶ added in v1.4.0
func InspectImagePayloadSize(ctx context.Context, imageRef, targetDigest string, spec *domain.OciRepoSpec, platform *ocispec.Platform) (*int64, error)
InspectImagePayloadSize returns the config and layer payload size for an OCI image. When targetDigest is set, it is used instead of resolving imageRef so a mutable tag cannot change between digest and size inspection.
func RegistryObjectRef ¶ added in v1.4.0
func RegistryObjectRef(spec *domain.OciRepoSpec, imageName string) (string, error)
func RemoteRepository ¶ added in v1.4.0
func RemoteRepository(ctx context.Context, spec *domain.OciRepoSpec, imageRef string) (*remote.Repository, string, error)
func RepoDestRef ¶ added in v1.4.0
func ResolveDeltaPushPath ¶ added in v1.4.0
func ResolveDeltaPushPath(spec *domain.OciRepoSpec, imageRepository string) (string, error)
func RewriteImageRef ¶ added in v1.4.0
func SpecForRegistry ¶ added in v1.4.0
func SpecForRegistry(host string, spec *domain.OciRepoSpec) *domain.OciRepoSpec
Types ¶
type DigestCache ¶ added in v1.4.0
type ImageDigestPair ¶ added in v1.4.0
type ImageDigestPair struct {
SourceDigest string `json:"sourceDigest"`
TargetDigest string `json:"targetDigest"`
}
ImageDigestPair contains the platform-specific source and target manifests used for OCI delta generation.
func CachedImageDigestPair ¶ added in v1.4.0
func CachedImageDigestPair( ctx context.Context, logger logrus.FieldLogger, cache DigestCache, orgID uuid.UUID, imageRef string, sourceDigest string, fallbackPlatform *ocispec.Platform, cacheTTL time.Duration, resolveImageDigest func(context.Context) (string, error), resolvePair func(context.Context, string) (ImageDigestPair, error), ) (ImageDigestPair, error)
CachedImageDigestPair resolves mutable target references through the short-lived image digest cache, then caches the pair by immutable target digest. The tag lookup can be stale for at most cacheTTL. The pair cache key also includes the source digest and fallback platform because a multi-platform target can resolve to a different leaf digest for different source platforms.
func InspectImageDigestPair ¶ added in v1.4.0
func InspectImageDigestPair( ctx context.Context, imageRef string, sourceDigest string, spec *domain.OciRepoSpec, fallbackPlatform *ocispec.Platform, ) (ImageDigestPair, error)
InspectImageDigestPair resolves sourceDigest to its platform-specific image manifest, then resolves imageRef to a manifest for the same platform. If the source digest is an image index, fallbackPlatform identifies the instance selected by the device runtime.