Documentation
¶
Index ¶
- Variables
- func ParseArtifact(artifact string) (repository, tag string)
- func RepositoryNameFromArtifact(artifact string) string
- func SelectTrustPolicyOverride(override config.OciTrustPolicyOverride, trusted bool) config.OciTrustPolicyOverride
- func TagFromArtifact(artifact string) string
- func VerifyWithCosign(ctx context.Context, artifactRef, digest string, ...) error
- type PullResult
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 ¶
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 ¶
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 ¶
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)
Click to show internal directories.
Click to hide internal directories.