ociimage

package
v4.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPerms

func CheckPerms(rootfs string) (err error)

CheckPerms will work through the rootfs of this bundle, and find if any directory does not have owner rwX - which may cause unexpected issues for a user trying to look through, or delete a sandbox

func FetchToLayout added in v4.1.0

func FetchToLayout(ctx context.Context, tOpts *TransportOptions, imgCache *cache.Handle, imageURI, tmpDir string) (ggcrv1.Image, error)

FetchToLayout will fetch the OCI image specified by imageRef to an OCI layout and return a v1.Image referencing it. If imgCache is non-nil, and enabled, the image will be fetched into Singularity's cache - which is a multi-image OCI layout. If the cache is disabled, the image will be fetched into a subdirectory of the provided tmpDir. The caller is responsible for cleaning up tmpDir.

func FixPerms

func FixPerms(rootfs string) (err error)

FixPerms will work through the rootfs of this bundle, making sure that all files and directories have permissions set such that the owner can read, modify, delete. This brings us to the situation of <=3.4

func ImageDigest

func ImageDigest(ctx context.Context, tOpts *TransportOptions, imgCache *cache.Handle, uri string) (ggcrv1.Hash, error)

ImageDigest obtains the digest of the image manifest for a uri-like image reference. If the reference points to a multi-arch repository with an image index (manifest list), it will traverse this to retrieve the digest of the image manifest for the requested architecture specified in tOpts.

func SupportedTransport added in v4.1.0

func SupportedTransport(transport string) string

SupportedTransport returns whether or not the transport given is supported. To fit within a switch/case statement, this function will return transport if it is supported

func UnpackRootfs

func UnpackRootfs(_ context.Context, srcImage v1.Image, destDir string) (err error)

UnpackRootfs extracts all of the layers of the given srcImage into destDir.

Types

type SourceSink added in v4.1.0

type SourceSink int
const (
	UnknownSourceSink SourceSink = iota
	RegistrySourceSink
	OCISourceSink
	TarballSourceSink
	DaemonSourceSink
)

func URItoSourceSinkRef added in v4.1.0

func URItoSourceSinkRef(imageURI string) (SourceSink, string, error)

URItoSourceSinkRef parses a uri-like OCI image reference into a SourceSink and ref

func (SourceSink) Image added in v4.1.0

func (ss SourceSink) Image(ctx context.Context, ref string, tOpts *TransportOptions, rt *progress.RoundTripper) (v1.Image, error)

func (SourceSink) Reference added in v4.1.0

func (ss SourceSink) Reference(s string, tOpts *TransportOptions) (name.Reference, bool)

func (SourceSink) WriteImage added in v4.1.0

func (ss SourceSink) WriteImage(img v1.Image, dstName string, tOpts *TransportOptions) error

type TransportOptions added in v4.1.0

type TransportOptions struct {
	// AuthConfig provides optional credentials to be used when interacting with
	// an image transport.
	AuthConfig *authn.AuthConfig
	// AuthFilePath provides an optional path to a file containing credentials
	// to be used when interacting with an image transport.
	AuthFilePath string
	// Insecure should be set to true in order to interact with a registry via
	// http, or without TLS certificate verification.
	Insecure bool
	// DockerDaemonHost provides the URI to use when interacting with a Docker
	// daemon.
	DockerDaemonHost string
	// Platform specifies the OS / Architecture / Variant that the pulled images
	// should satisfy.
	Platform v1.Platform
	// UserAgent will be set on HTTP(S) request made by transports.
	UserAgent string
	// TmpDir is a location in which a transport can create temporary files.
	TmpDir string
}

TransportOptions provides authentication, platform etc. configuration for interactions with image transports.

func TransportOptionsFromSystemContext deprecated added in v4.1.0

func TransportOptionsFromSystemContext(sc *types.SystemContext) *TransportOptions

TransportOptionsFromSystemContext returns a TransportOptions struct initialized from a containers/image SystemContext. If the SystemContext is nil, then nil is returned.

Deprecated: for containers/image compatibility only. To be removed in SingularityCE v5.

func (*TransportOptions) SystemContext deprecated added in v4.1.0

func (t *TransportOptions) SystemContext() types.SystemContext

SystemContext returns a containers/image/v5 types.SystemContext struct for compatibility with operations that still use containers/image.

Deprecated: for containers/image compatibility only. To be removed in SingularityCE v5.

Jump to

Keyboard shortcuts

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