lineage

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 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

Overview

Package lineage derives parent edges between images from their layer stacks, adds the parents images declare in annotations and labels, and materializes ancestry facts for fast queries.

The parent of an image is the indexed stack that is the longest exact prefix of its own stack. Stacks are compared by chain ID, so the work is a handful of joins over image_prefixes rather than any layer comparison.

When two or more stacks share a prefix that no indexed image ends at, that prefix is a common ancestor that was deleted or never pushed. It is kept as a phantom node keyed by its chain ID, so the tree stays intact, unless only one repo's images share it below another node: that is the repo's build cache, not a base.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recompute

func Recompute(ctx context.Context, db *sql.DB, opts Options) ([]string, error)

Recompute rebuilds the edges, phantoms and lineage tables from the images in the index. It computes them in full but writes only the rows that differ from what is stored, since rewriting every row costs far more than the comparison, and returns the nodes whose lineage row changed: a new parent, root, generation, child or descendant count, or conflict.

Types

type Options

type Options struct {
	// Labels are label or annotation keys whose value names the image's
	// base, as a repo:tag or digest. The OCI base annotations are always
	// read.
	Labels []string
}

Options controls which declared parents are read.

Jump to

Keyboard shortcuts

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