oci

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: Apache-2.0 Imports: 41 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

View Source
var ErrRetryLimitExceeded = errors.New("retry limit exceeded")

ErrRetryLimitExceeded indicates the function was retried too many times.

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, target oras.ReadOnlyTarget, desc ocispec.Descriptor) (io.ReadCloser, error)

func GetManifestForHost added in v0.26.0

func GetManifestForHost(ctx context.Context, target oras.ReadOnlyTarget, 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 AllowedGadgetsOptions added in v0.31.0

type AllowedGadgetsOptions struct {
	AllowedGadgets []string
}

type AuthOptions

type AuthOptions struct {
	AuthFile    string
	SecretBytes []byte
	// InsecureRegistries is a list of registries that should be accessed over
	// plain HTTP.
	InsecureRegistries []string
	DisallowPulling    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 GetGadgetImageDesc added in v0.33.0

func GetGadgetImageDesc(ctx context.Context, image string) (*GadgetImageDesc, error)

func GetGadgetImages added in v0.33.0

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

GetGadgetImages gets 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
	AllowedGadgetsOptions

	Logger logger.Logger
}

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
	PublicKeys      []string
}

Jump to

Keyboard shortcuts

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