patch

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 45 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ARM64 = "arm64"
)
View Source
const (

	// DefaultLocalExportCompression is the BuildKit compression used for newly
	// created patch layers when loading patched images locally.
	DefaultLocalExportCompression = "uncompressed"
)
View Source
const (
	LINUX = "linux"
)

Variables

This section is empty.

Functions

func ArchTagSuffixes added in v0.14.0

func ArchTagSuffixes() []string

ArchTagSuffixes returns the set of architecture suffixes that Copa appends to base tags when pushing per-architecture images (e.g. "386", "amd64", "arm-v7"). The list is derived from validPlatforms so it stays in sync automatically.

func Patch

func Patch(ctx context.Context, opts *types.Options) error

Patch command applies package updates to an OCI image given a vulnerability report for a given set of options.

Types

type BuildConfig added in v0.11.1

type BuildConfig struct {
	SolveOpt        client.SolveOpt
	ShouldExportOCI bool
	PipeWriter      io.WriteCloser
}

BuildConfig holds configuration for building and exporting images.

type Context added in v0.11.1

type Context struct {
	Context context.Context
	Client  gwclient.Client
}

Context wraps the context and gateway client for core operations.

type Options added in v0.11.1

type Options struct {
	// Image and platform information
	ImageName      string
	TargetPlatform *types.PatchPlatform

	// Update information
	Updates          *unversioned.UpdateManifest
	ValidatedUpdates *unversioned.UpdateManifest

	// Working environment
	WorkingFolder string
	IgnoreError   bool
	ChiselRelease string

	// Optional error channel for patch command integration
	ErrorChannel chan error

	// If true, return the BuildKit state instead of solving it
	ReturnState bool

	// Toolchain patch level (e.g., "patch", "minor", "major"; empty = disabled)
	ToolchainPatchLevel string
	GoVCSURL            string

	// EOL configuration
	ExitOnEOL bool
}

Options contains the parameters needed for the core patching logic.

type Result added in v0.11.1

type Result struct {
	// BuildKit gateway result (nil if ReturnState is true)
	Result *gwclient.Result

	// Package manager information
	PackageType      string
	ErroredPackages  []string
	ValidatedUpdates []unversioned.UpdatePackage
	Annotations      map[string]string

	// BuildKit state and config (only set if ReturnState is true)
	PatchedState *llb.State
	ConfigData   []byte
}

Result contains the result of the core patching operation.

func ExecutePatchCore added in v0.11.1

func ExecutePatchCore(patchCtx *Context, opts *Options) (*Result, error)

ExecutePatchCore executes the core patching logic that can be used by both the patch command and a buildkit frontend.

Jump to

Keyboard shortcuts

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