Documentation
¶
Index ¶
- func AppendGitMetadata(parent context.Context, repoPath string, annotations map[string]string)
- func BuildArtifact(dstFile, contentPath string, ignorePaths []string) error
- func ListArtifactTags(ociURL string, withDigest bool, opts []crane.Option) ([]apiv1.ArtifactReference, error)
- func ListModuleVersions(ociURL string, withDigest bool, opts []crane.Option) ([]apiv1.ModuleReference, error)
- func Options(ctx context.Context, credentials string, insecure bool) []crane.Option
- func ParseAnnotations(args []string) (map[string]string, error)
- func ParseArtifactURL(ociURL string) (string, error)
- func ParseDigest(ociURL string) (name.Digest, error)
- func ParseRepositoryURL(ociURL string) (string, error)
- func PullArtifact(ociURL, dstPath, contentType string, opts []crane.Option) error
- func PullModule(ociURL, dstPath, cacheDir string, opts []crane.Option) (*apiv1.ModuleReference, error)
- func PushArtifact(ociURL, contentPath string, ignorePaths []string, contentType string, ...) (result string, err error)
- func PushModule(ociURL, contentPath string, ignorePaths []string, ...) (result string, err error)
- func SignArtifact(ctx context.Context, log logr.Logger, provider string, ociURL string, ...) error
- func SignCosign(ctx context.Context, log logr.Logger, imageRef string, keyRef string, ...) (retErr error)
- func TagArtifact(ociURL, tag string, opts []crane.Option) error
- func ValidateSigningProvider(provider string) error
- func ValidateTag(tag string) error
- func ValidateVerificationProvider(provider string) error
- func VerifyArtifact(ctx context.Context, log logr.Logger, provider string, ociURL string, ...) error
- func VerifyCosign(ctx context.Context, log logr.Logger, imageRef string, keyRef string, ...) (retErr error)
- func WriteImage(image gcrv1.Image, destination string, format LocalFormat, references []string) error
- type ImageBuild
- type LocalFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendGitMetadata ¶
AppendGitMetadata fills missing creation, source, and revision annotations. Creation uses SOURCE_DATE_EPOCH before Git commit time; Git failures and cancellations are ignored.
func BuildArtifact ¶
BuildArtifact creates the destination file and packages the given content (excluding symlinks) using tar+gzip compression.
func ListArtifactTags ¶
func ListArtifactTags(ociURL string, withDigest bool, opts []crane.Option) ([]apiv1.ArtifactReference, error)
ListArtifactTags performs the following operations: - fetches the digest of the latest tag (if it exists) - lists all the tags from the artifact repository - fetches the digest of each tag (if configured to do so) - returns an array of ArtifactReference objects
func ListModuleVersions ¶
func ListModuleVersions(ociURL string, withDigest bool, opts []crane.Option) ([]apiv1.ModuleReference, error)
ListModuleVersions performs the following operations: - lists all the tags from to this module repository - filters and orders the tags based on semver - fetches the digest of the latest version - fetches the digest of each version (if configured to do so) - returns an array of ModuleReference objects
func ParseAnnotations ¶
ParseAnnotations parses key=value pairs and preserves additional equals signs in values.
func ParseArtifactURL ¶
ParseArtifactURL validates the OpenContainers URL and returns the address of the artifact.
func ParseDigest ¶
ParseDigest extracts the digest from the OpenContainers URL.
func ParseRepositoryURL ¶
ParseRepositoryURL validates the OpenContainers URL and returns the address of the artifact repository.
func PullArtifact ¶
PullArtifact performs the following operations: - fetches the manifest of the remote artifact - verifies that artifact config matches Timoni's media type - download all the compressed layer matching Timoni's media type - extracts the layers contents to the destination directory
func PullModule ¶
func PullModule(ociURL, dstPath, cacheDir string, opts []crane.Option) (*apiv1.ModuleReference, error)
PullModule performs the following operations: - determines the artifact digest corresponding to the module version - fetches the manifest of the remote artifact - verifies that artifact config matches Timoni's media type - downloads all compressed layers matching Timoni's media type (if not cached) - atomically stores the compressed layers in the local cache (if caching is enabled) - extracts the module contents to the destination directory
func PushArtifact ¶
func PushArtifact(ociURL, contentPath string, ignorePaths []string, contentType string, annotations map[string]string, opts []crane.Option) (result string, err error)
PushArtifact builds and pushes a single-layer OCI artifact, then returns its digest URL.
func PushModule ¶
func PushModule(ociURL, contentPath string, ignorePaths []string, annotations map[string]string, opts []crane.Option) (result string, err error)
PushModule builds and pushes ordered vendor and module layers, then returns the module's digest URL.
func SignArtifact ¶
func SignArtifact(ctx context.Context, log logr.Logger, provider string, ociURL string, keyRef string, insecure bool, credentials string) error
SignArtifact validates the provider and signs an OpenContainers artifact with the requested registry credentials and transport.
func SignCosign ¶
func SignCosign(ctx context.Context, log logr.Logger, imageRef string, keyRef string, insecure bool, credentials string) (retErr error)
SignCosign signs an image with the requested registry credentials and transport.
func TagArtifact ¶
TagArtifact validates and adds the tag to the remote OpenContainers artifact.
func ValidateSigningProvider ¶ added in v0.28.0
ValidateSigningProvider reports whether the signing provider is supported and available.
func ValidateTag ¶ added in v0.28.0
ValidateTag reports whether tag follows the OCI Distribution tag grammar.
func ValidateVerificationProvider ¶ added in v0.29.0
ValidateVerificationProvider reports whether the verification provider is supported and available.
func VerifyArtifact ¶
func VerifyArtifact(ctx context.Context, log logr.Logger, provider string, ociURL string, keyRef string, certIdentity string, certIdentityRegexp string, certOidcIssuer string, certOidcIssuerRegexp string, insecure bool, credentials string) error
VerifyArtifact validates the provider and verifies an OpenContainers artifact with the requested registry credentials and transport.
func VerifyCosign ¶
func VerifyCosign(ctx context.Context, log logr.Logger, imageRef string, keyRef string, certIdentity string, certIdentityRegexp string, certOidcIssuer string, certOidcIssuerRegexp string, insecure bool, credentials string) (retErr error)
VerifyCosign verifies an image and optionally permits insecure registry transport. Keyless flows require an identity and an OIDC issuer or their regular-expression alternatives.
func WriteImage ¶ added in v0.28.0
func WriteImage(image gcrv1.Image, destination string, format LocalFormat, references []string) error
WriteImage validates and writes an image to a new OCI layout or archive. References become OCI layout descriptor names and must use Timoni's local syntax.
Types ¶
type ImageBuild ¶ added in v0.28.0
type ImageBuild struct {
Image gcrv1.Image
Digest gcrv1.Hash
// contains filtered or unexported fields
}
ImageBuild owns a completed OCI image, its digest, and temporary layer files.
func BuildArtifactImage ¶ added in v0.28.0
func BuildArtifactImage(contentPath string, ignorePaths []string, contentType string, annotations map[string]string) (*ImageBuild, error)
BuildArtifactImage packages contentPath as a single-layer OCI image.
func BuildModuleImage ¶ added in v0.28.0
func BuildModuleImage(contentPath string, ignorePaths []string, annotations map[string]string) (*ImageBuild, error)
BuildModuleImage packages a module as ordered vendor and module layers.
func (*ImageBuild) Close ¶ added in v0.28.0
func (b *ImageBuild) Close() error
Close removes the temporary layer files owned by the build.
func (*ImageBuild) CloseWithError ¶ added in v0.29.0
func (b *ImageBuild) CloseWithError(err error) error
CloseWithError removes temporary layer files and preserves an earlier error.
type LocalFormat ¶ added in v0.28.0
type LocalFormat string
LocalFormat identifies an OCI filesystem output format.
const ( FormatArchive LocalFormat = "oci-archive" FormatLayout LocalFormat = "oci-layout" )
func (LocalFormat) Validate ¶ added in v0.28.0
func (f LocalFormat) Validate() error
Validate reports whether the local OCI output format is supported.