Help us shape the future of Go! Take the 2026 Go Developer Survey

capture

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package capture snapshots an installed prefix into a signed squashfs layer.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("capture: strata capture requires Linux")

ErrNotSupported is returned on non-Linux platforms where capture is unavailable.

Functions

func NormalizePaths

func NormalizePaths(_ context.Context, dir, originalPrefix, newPrefix string) (modified int, warnings []string, err error)

NormalizePaths rewrites originalPrefix → newPrefix in dir (in-place). Handles: ELF RPATH/interpreter (via patchelf), shebangs, .pc, .la, .cmake files. Never errors on individual files — puts failures in warnings slice.

Types

type Config

type Config struct {
	Name, Version, Prefix string       // all required
	ABI, Arch             string       // auto-detected if empty
	Normalize             bool         // rewrite paths (default: preserve-prefix)
	CaptureSource         string       // "lmod", "conda", "filesystem", ""
	OriginalPrefix        string       // = Prefix unless Normalize applied
	Signer                trust.Signer // nil = no signing
	Registry              PushRegistry // required unless DryRun
	DryRun                bool
	TempDir               string
	Provides              []spec.Capability
	Requires              []spec.Requirement
}

Config holds the configuration for a capture operation.

type PushRegistry

type PushRegistry interface {
	PushLayer(ctx context.Context, manifest *spec.LayerManifest,
		sqfsPath string, bundleJSON []byte) error
}

PushRegistry is the narrow interface capture needs from the registry. Satisfied by *registry.S3Client and *registry.LocalClient.

type Result

type Result struct {
	Manifest    *spec.LayerManifest
	SqfsPath    string
	RegistryURI string
}

Result is returned on a successful capture.

func Capture

func Capture(ctx context.Context, cfg Config) (*Result, error)

Capture snapshots an installed prefix into a signed squashfs layer and pushes it to the registry.

Jump to

Keyboard shortcuts

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