oci

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArchAmd64 = "amd64"
	ArchArm64 = "arm64"
	ArchWasm  = "wasm"
)
View Source
const (
	DefaultAuthFile = "/var/lib/ig/config.json"

	PullImageAlways  = "always"
	PullImageMissing = "missing"
	PullImageNever   = "never"
)

Variables

This section is empty.

Functions

func DeleteGadgetImage added in v0.24.0

func DeleteGadgetImage(ctx context.Context, image string) error

DeleteGadgetImage removes the given image.

func EnsureImage added in v0.26.0

func EnsureImage(ctx context.Context, image string, authOpts *AuthOptions, pullPolicy string) error

EnsureImage ensures the image is present in the local store

func GetContentFromDescriptor added in v0.26.0

func GetContentFromDescriptor(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)

func GetManifestForHost added in v0.26.0

func GetManifestForHost(ctx context.Context, image string) (*ocispec.Manifest, error)

Types

type AuthOptions

type AuthOptions struct {
	AuthFile    string
	SecretBytes []byte
	Insecure    bool
}

type BuildGadgetImageOpts

type BuildGadgetImageOpts struct {
	// Source path of the eBPF program. Currently it's not used for compilation purposes
	EBPFSourcePath string
	// List of eBPF objects to include in the image. The key is the architecture and the value
	// is the path to the eBPF object.
	EBPFObjectPaths map[string]string
	// Path to the metadata file.
	MetadataPath string
	// Optional path to the Wasm file
	WasmObjectPath string
	// If true, the metadata is updated to follow changes in the eBPF objects.
	UpdateMetadata bool
	// If true, the metadata is validated before creating the image.
	ValidateMetadata bool
	// Date and time on which the image is built (date-time string as defined by RFC 3339).
	CreatedDate string
}

type GadgetImage

type GadgetImage struct {
	EbpfObject []byte
	WasmObject []byte
	Metadata   []byte
}

GadgetImage is the representation of a gadget packaged in an OCI image.

func GetGadgetImage

func GetGadgetImage(ctx context.Context, image string, authOpts *AuthOptions, pullPolicy string) (*GadgetImage, error)

GetGadgetImage pulls the gadget image according to the pull policy and returns a GadgetImage structure representing it.

type GadgetImageDesc

type GadgetImageDesc struct {
	Repository string `column:"repository"`
	Tag        string `column:"tag"`
	Digest     string `column:"digest,width:12,fixed"`
	Created    string `column:"created"`
}

GadgetImageDesc is the description of a gadget image.

func BuildGadgetImage

func BuildGadgetImage(ctx context.Context, opts *BuildGadgetImageOpts, image string) (*GadgetImageDesc, error)

BuildGadgetImage creates an OCI image with the objects provided in opts. The image parameter in the "name:tag" format is used to name and tag the created image. If it's empty the image is not named.

func ListGadgetImages

func ListGadgetImages(ctx context.Context) ([]*GadgetImageDesc, error)

ListGadgetImages lists all the gadget images.

func PullGadgetImage

func PullGadgetImage(ctx context.Context, image string, authOpts *AuthOptions) (*GadgetImageDesc, error)

PullGadgetImage pulls the gadget image into the local oci store and returns its descriptor.

func PushGadgetImage

func PushGadgetImage(ctx context.Context, image string, authOpts *AuthOptions) (*GadgetImageDesc, error)

PushGadgetImage pushes the gadget image and returns its descriptor.

func TagGadgetImage

func TagGadgetImage(ctx context.Context, srcImage, dstImage string) (*GadgetImageDesc, error)

TagGadgetImage tags the src image with the dst image.

func (*GadgetImageDesc) String

func (d *GadgetImageDesc) String() string

Jump to

Keyboard shortcuts

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