Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func SolveApplicationSet ¶
func SolveApplicationSet(ctx context.Context, applications ApplicationIndex, applicationset *unikornv1.ApplicationSet) (sat.Set[AppVersion], error)
SolveApplicationSet walks the graph Dykstra style loading in referenced dependencies. Where things get interesting is if a dependency is pulled in multiple times but the originally selected version conflicts with other dependency constraints then we have a conflict, and have to backtrack and try again with another version. Unlike typical SAT solver problems, choosing a different version can have the fun effect of changing its dependencies!
Types ¶
type AppVersion ¶
type AppVersion struct {
Name string
Version unikornv1core.SemanticVersion
}
AppVersion wraps up applicationID and version tuples in a comparable and easy to use form when interacting with the SAT solver.
func NewAppVersion ¶
func NewAppVersion(name string, version unikornv1core.SemanticVersion) AppVersion
type ApplicationIndex ¶
type ApplicationIndex map[string]*unikornv1core.HelmApplication
func NewApplicationIndex ¶
func NewApplicationIndex(applications ...*unikornv1core.HelmApplication) (ApplicationIndex, error)
func (ApplicationIndex) Get ¶
func (i ApplicationIndex) Get(name string) (*unikornv1core.HelmApplication, error)
type GraphVisitor ¶
type GraphVisitor[T comparable] interface { // Visit is called when a new node is encountered, it accepts // the node itself and an enqueue function. Visit(node T, enqueue func(T)) error }
GraphVisitor is used to visit a node in the graph.
type GraphWalker ¶
type GraphWalker[T comparable] struct { // contains filtered or unexported fields }
func NewGraphWalker ¶
func NewGraphWalker[T comparable]() *GraphWalker[T]
func (*GraphWalker[T]) Enqueue ¶
func (g *GraphWalker[T]) Enqueue(t T)
func (*GraphWalker[T]) Walk ¶
func (g *GraphWalker[T]) Walk(visitor GraphVisitor[T]) error
Click to show internal directories.
Click to hide internal directories.