oci

package
v0.91.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDigestMismatch        = errors.New("artifact digest does not match expected digest")
	ErrUnsupportedLayout     = errors.New("unsupported OCI layout")
	ErrInvalidArtifactLayout = errors.New("invalid OCI artifact layout")
)
View Source
var (
	ErrNoTrustRules       = errors.New("OCI trust policy has no trust rules")
	ErrVerificationFailed = errors.New("OCI artifact signature verification failed")
)

Functions

func ParseArtifact

func ParseArtifact(artifact string) (repository, tag string)

ParseArtifact parses an OCI artifact reference and returns the repository name and tag. For "ghcr.io/org/repo:latest" it returns ("ghcr.io/org/repo", "latest"). Tag defaults to "latest" when not specified (standard OCI behaviour). On parse failure the trimmed artifact string is returned as the repository name with an empty tag.

func RepositoryNameFromArtifact

func RepositoryNameFromArtifact(artifact string) string

RepositoryNameFromArtifact returns the repository portion of an OCI artifact reference.

func SelectTrustPolicyOverride added in v0.90.1

func SelectTrustPolicyOverride(override config.OciTrustPolicyOverride, trusted bool) config.OciTrustPolicyOverride

SelectTrustPolicyOverride returns deployment-level OCI trust policy overrides only when the deployment configuration origin is trusted.

func TagFromArtifact

func TagFromArtifact(artifact string) string

TagFromArtifact returns the tag (or digest identifier) of an OCI artifact reference.

func VerifyWithCosign

func VerifyWithCosign(ctx context.Context, artifactRef, digest string, globalPolicy config.OciTrustPolicy, override config.OciTrustPolicyOverride, maxWorkers uint) error

Types

type PullResult

type PullResult struct {
	Digest string
}

func PullAndExtract

func PullAndExtract(ctx context.Context, artifactRef, expectedDigest, layout, destination string) (PullResult, error)

Jump to

Keyboard shortcuts

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