Documentation
¶
Index ¶
Constants ¶
const HivePrefix = "__hive__/"
HivePrefix is the Dockerfile image reference prefix used to denote project-local hive dependencies.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph represents a dependency graph of container images. Edges encode "from depends on to", meaning "to" must be built before "from".
func BuildDependencyGraph ¶
func BuildDependencyGraph(scannedGraph *Graph, project *model.ContainerHiveProject) (*Graph, error)
BuildDependencyGraph merges a scanned dependency graph (from Dockerfile analysis) with explicit depends_on declarations from image configs.
func ScanProjectSource ¶
func ScanProjectSource(project *model.ContainerHiveProject) *Graph
ScanProjectSource scans source Dockerfiles from the project model for __hive__/ references and builds a dependency graph. This is used by CI template generation where the rendered dist directory may not exist yet.
func ScanRenderedProject ¶
ScanRenderedProject scans all Dockerfiles in a rendered dist directory and builds a dependency graph based on __hive__/ references.
func (*Graph) AddDependency ¶
AddDependency records that "from" depends on "to", meaning "to" must be built before "from".
func (*Graph) Dependencies ¶
Dependencies returns the list of images that the given image depends on.
func (*Graph) Dependents ¶
Dependents returns the list of images that depend on the given image.
func (*Graph) HasDependencies ¶
HasDependencies returns true if any dependency edges exist in the graph.
func (*Graph) TopologicalSort ¶
TopologicalSort returns a build order where dependencies come first. It uses Kahn's algorithm and returns an error if a cycle is detected.
type HiveRef ¶
HiveRef represents a reference to a project-local image via the __hive__/ prefix.
func ScanDockerfileForHiveRefs ¶
ScanDockerfileForHiveRefs scans a Dockerfile for FROM __hive__/<name>:<tag> references.