Documentation
¶
Index ¶
- func ArtifactFallbackStoreRootDir() string
- func ArtifactStoreRootDir() string
- func ArtifactWorkRootDir() string
- func EnsureArtifactBuildPreflight(ctx context.Context) error
- func NormalizeBaseURL(baseURL string) string
- func ResolveArtifactStoreDir(ctx context.Context, artifactID string) (string, error)
- func StreamRegistryToDir(ctx context.Context, source *PreparedSource, destDir string) error
- type BuildOptions
- type BuildResult
- type DockerImageConfig
- type ExportMode
- type PreparedSource
- type ProgressFunc
- type PullProgress
- type RegistryAuthConfig
- type SourceSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArtifactFallbackStoreRootDir ¶
func ArtifactFallbackStoreRootDir() string
func ArtifactStoreRootDir ¶
func ArtifactStoreRootDir() string
func ArtifactWorkRootDir ¶
func ArtifactWorkRootDir() string
func EnsureArtifactBuildPreflight ¶
EnsureArtifactBuildPreflight asserts that the host has all necessary tools installed to build images before starting a long-running workflow.
func NormalizeBaseURL ¶
func ResolveArtifactStoreDir ¶
func StreamRegistryToDir ¶
func StreamRegistryToDir(ctx context.Context, source *PreparedSource, destDir string) error
StreamRegistryToDir fetches and applies OCI layers directly into destDir.
Types ¶
type BuildOptions ¶
type BuildOptions struct {
ArtifactID string
// PostRootfsExport is invoked after the image rootfs has been exported to
// the working directory but before mkfs.ext4 runs, so callers can mutate
// the rootfs (e.g. bake the CubeEgress root CA into the trust store). The
// callback receives the rootfs directory path that mkfs.ext4 will consume.
// A non-nil error aborts the build.
PostRootfsExport func(ctx context.Context, rootfsDir string) error
}
type BuildResult ¶
func BuildExt4 ¶
func BuildExt4(ctx context.Context, source *PreparedSource, opts BuildOptions) (BuildResult, error)
type DockerImageConfig ¶
type ExportMode ¶
type ExportMode string
ExportMode defines the backend used for exporting the image rootfs.
const ( ExportModeDocker ExportMode = "" // Default backward-compatible fallback ExportModeDockerless ExportMode = "dockerless" ExportModeNative ExportMode = "native" )
type PreparedSource ¶
type PreparedSource struct {
LocalRef string
Digest string
Config DockerImageConfig
ConfigJSON string
MasterNodeIP string
SkopeoAuthFile string
// CompressedSizeBytes is the sum of compressed layer blob sizes reported by
// skopeo inspect on the dockerless path, or by the image manifest on the
// native path. It lets disk-space pre-checks estimate image size without
// invoking the docker daemon. Zero means "unknown".
CompressedSizeBytes int64
// ExportMode is determined during the Prepare phase and controls which path is used during the Export phase.
// An empty value is equivalent to ExportModeDocker (for backward compatibility).
ExportMode ExportMode
// RegistryAuth preserves the original Registry credentials for use by the native path.
RegistryAuth *RegistryAuthConfig
Cleanup func(context.Context)
// OnPullProgress is propagated from SourceSpec so that the export phase
// (skopeo copy on the dockerless path) can stream pull progress even
// though it runs after PrepareSource has returned.
OnPullProgress ProgressFunc
// contains filtered or unexported fields
}
func PrepareLocalSource ¶
func PrepareLocalSource(ctx context.Context, spec SourceSpec) (*PreparedSource, error)
func PrepareSource ¶
func PrepareSource(ctx context.Context, spec SourceSpec) (*PreparedSource, error)
type ProgressFunc ¶
type ProgressFunc func(PullProgress)
ProgressFunc receives pull-progress updates. Implementations must be safe to call from the goroutines that stream subprocess output. A nil ProgressFunc disables progress streaming and preserves the original buffered-exec behaviour (see command.go).
type PullProgress ¶
type PullProgress struct {
TotalBytes int64
DownloadedBytes int64
TotalLayers int
CompletedLayers int
SpeedBPS int64
Percent float64
}
PullProgress is a best-effort snapshot of source-image pull progress.
Two granularities are represented because the two pull backends expose different information:
- skopeo copy (dockerless path) reports per-blob byte counters, so TotalBytes/DownloadedBytes are populated and Percent is byte-accurate.
- docker pull (docker path) in non-TTY mode only reports per-layer status transitions, so only TotalLayers/CompletedLayers are populated and Percent is derived from completed layers.
Consumers should prefer byte fields when TotalBytes > 0 and fall back to the layer fields otherwise.
type RegistryAuthConfig ¶
RegistryAuthConfig holds the authentication credentials used for pulling the image natively from the registry without relying on external CLI tools.
type SourceSpec ¶
type SourceSpec struct {
ImageRef string
RegistryUsername string
RegistryPassword string
DownloadBaseURL string
// OnPullProgress, when non-nil, receives best-effort source-image pull
// progress updates while the image is fetched (docker pull on the docker
// path, skopeo copy on the dockerless path). A nil value disables progress
// streaming and preserves the original buffered-exec behaviour.
OnPullProgress ProgressFunc
}