util

package
v0.0.0-...-9e06024 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	AnnotationDockerReferenceDigest = "vnd.docker.reference.digest"
	AnnotationDockerReferenceType   = "vnd.docker.reference.type"
	AnnotationAttestationManifest   = "attestation-manifest"
	AnnotationInTotoPredicateType   = "in-toto.io/predicate-type"
	AnnotationSPDXDoc               = "https://spdx.dev/Document"
)

Variables

This section is empty.

Functions

func AppendIndex

func AppendIndex(primary, secondary v1.ImageIndex) (v1.ImageIndex, error)

AppendIndex creates a new ImageIndex composed of the merge of the elements of secondary ImageIndex and primary ImageIndex. In the case of conflicts, the primary ImageIndex wins. For example, if both have a manifest for a specific platform, then use the one from primary. The append is aware of the buildkit-style attestations, and will keep any attestations that point to a valid manifest in the list, discarding any that do not. If either of the two ImageIndexes is nil, the other is returned. If the secondary ImageIndex is a precise superset of primary, then the returned new ImageIndex is an identical copy of the secondary ImageIndex.

func GoArch

func GoArch(in string) (string, error)

GoArch turn an input arch into a go arch

func HomeDir

func HomeDir() string

HomeDir get the home directory for the user based on the HOME environment variable.

func MArch

func MArch(in string) (string, error)

MArch turn an input arch into a canonical arch as given by `uname -m`

func ReferenceExpand

func ReferenceExpand(ref string, options ...ReferenceOption) string

ReferenceExpand expands "redis" to "docker.io/library/redis" so all images have a full domain, and similarly foo/bar to docker.io/foo/bar. If the image does not have a tag, ":latest" is added.

func SetupLogging

func SetupLogging(quiet, verbose bool) error

SetupLogging once the flags have been parsed, setup the logging

Types

type ReferenceOption

type ReferenceOption func(r *refOpts)

func ReferenceWithTag

func ReferenceWithTag() ReferenceOption

ReferenceWithTag returns a ReferenceOption that ensures a tag is filled. If the tag is not provided, the default is added

Jump to

Keyboard shortcuts

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