oci

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 35 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, imgOpts *ImageOptions, pullPolicy string) error

EnsureImage ensures the image is present in the local store

func ExportGadgetImages added in v0.28.0

func ExportGadgetImages(ctx context.Context, dstFile string, images ...string) error

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)

func ImportGadgetImages added in v0.28.0

func ImportGadgetImages(ctx context.Context, srcFile string) ([]string, error)

ImportGadgetImages imports all the tagged gadget images from the src file.

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
	// are the paths to the objects.
	ObjectPaths map[string]*ObjectPath
	// Path to the metadata file.
	MetadataPath 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 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

type ImageOptions added in v0.28.0

type ImageOptions struct {
	AuthOptions
	VerifyOptions
}

type ObjectPath added in v0.28.0

type ObjectPath struct {
	// Path to the EBPF object
	EBPF string
	// Optional path to the Wasm file
	Wasm string
	// Optional path to tarball containing BTF files generated with btfgen
	Btfgen string
}

type VerifyOptions added in v0.28.0

type VerifyOptions struct {
	VerifyPublicKey bool
	PublicKey       string
}

Jump to

Keyboard shortcuts

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