common

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LINUX = "linux"
)

Variables

This section is empty.

Functions

func DisplayProgress

func DisplayProgress(ctx context.Context, eg *errgroup.Group, buildChannel chan *client.SolveStatus, progress progressui.DisplayMode)

DisplayProgress starts a goroutine to display build progress. This encapsulates the common pattern used in both generate and patch commands.

func GetDefaultLinuxPlatform

func GetDefaultLinuxPlatform() ispec.Platform

GetDefaultLinuxPlatform returns a normalized Linux platform, defaulting to Linux if not already Linux.

func GetRepoNameWithDigest added in v0.12.0

func GetRepoNameWithDigest(patchedImageName, imageDigest string) string

GetRepoNameWithDigest extracts repo name with digest from image name and digest. e.g. "docker.io/library/nginx:1.21.6-patched" -> "nginx@sha256:...".

func ResolvePatchedImageName added in v0.12.0

func ResolvePatchedImageName(imageRef reference.Named, explicitTag, suffix string) (imageName, patchTag string, err error)

ResolvePatchedImageName merges with suffix rules or uses the explicitTag entirely, returning the final patched image name and tag.

func ResolvePatchedTag

func ResolvePatchedTag(imageRef reference.Named, explicitTag, suffix string) (string, error)

ResolvePatchedTag merges explicit tag & suffix rules, returning the final patched tag.

func SetupBuildkitConfigAndManager

func SetupBuildkitConfigAndManager(
	ctx context.Context,
	c gwclient.Client,
	image string,
	platform *ispec.Platform,
	workingFolder string,
	osInfo *OSInfo,
) (*buildkit.Config, pkgmgr.PackageManager, error)

SetupBuildkitConfigAndManager initializes buildkit config and package manager. This combines the common pattern used in both generate and patch commands.

Types

type OSInfo

type OSInfo struct {
	Type    string
	Version string
}

OSInfo contains the OS type and version information.

func GetOSInfo

func GetOSInfo(ctx context.Context, osreleaseBytes []byte) (*OSInfo, error)

GetOSInfo extracts OS type and version from os-release data.

Jump to

Keyboard shortcuts

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