Documentation
¶
Index ¶
Constants ¶
const (
ProjectRootPath = "."
)
Variables ¶
Functions ¶
func WithPackagePath ¶
func WithPackagePath(packagePath string) buildOption
WithPackagePath provides package path configuration.
func WithProjectRoot ¶
func WithProjectRoot(projectRootPath string) buildOption
WithProjectRoot provides the path to the project root.
Types ¶
type BuildResult ¶ added in v0.25.0
type BuildResult struct {
Instances []Instance
UpdateInstructions []version.UpdateInstruction
}
type Builder ¶
type Builder struct {
}
Builder compiles and decodes CUE kubernetes manifest definitions of a component to the corresponding Go struct.
func (Builder) Build ¶
func (b Builder) Build(opts ...buildOption) (*BuildResult, error)
Build accepts options defining which cue package to compile and compiles it to a slice of component Instances.
type DependencyGraph ¶
type DependencyGraph struct {
// contains filtered or unexported fields
}
DependencyGraph is an adjacency list which represents the directed acyclic graph of component dependencies. The Dependencies field in the Node struct holds a list of other component ids to which the current component has edges.
func NewDependencyGraph ¶
func NewDependencyGraph() DependencyGraph
func (*DependencyGraph) Delete ¶
func (graph *DependencyGraph) Delete(componentID string)
func (*DependencyGraph) Get ¶
func (graph *DependencyGraph) Get(componentID string) Instance
Get returns the Component if it has been identified by its id. It returns nil if no Node has been found.
func (*DependencyGraph) Insert ¶
func (graph *DependencyGraph) Insert(nodes ...Instance) error
Insert places given Nodes into the DependencyGraph. It returns an error if a given Node id / component id already exists in the graph.
func (*DependencyGraph) TopologicalSort ¶
func (dag *DependencyGraph) TopologicalSort() ([]Instance, error)
TopologicalSort performs a topological sort on the component dependency graph and returns the sorted order. It returns an error if a cycle is detected.
type ExtendedUnstructured ¶ added in v0.24.6
type ExtendedUnstructured = kube.ExtendedUnstructured
type FieldMetadata ¶ added in v0.24.6
type FieldMetadata = kube.ManifestFieldMetadata
type Instance ¶
Instance represents a Declcd component with its id, dependencies and content. It is the Go equivalent of the CUE definition the user interacts with. ID is constructed based on the content of the component.
type Reconciler ¶ added in v0.24.0
type Reconciler struct {
Log logr.Logger
// DynamicClient connects to a Kubernetes cluster
// to create, read, update and delete manifests/objects.
DynamicClient *kube.ExtendedDynamicClient
// ChartReconciler reads Helm Packages with their desired state
// and applies them on a Kubernetes cluster.
// It stores releases in the inventory, but never collects it.
ChartReconciler helm.ChartReconciler
// Instance is a representation of an inventory.
// It can store, delete and read items.
// The object does not include the storage itself, it only holds a reference to the storage.
InventoryInstance *inventory.Instance
// Managers identify distinct workflows that are modifying the object (especially useful on conflicts!),
FieldManager string
}
Reconciler reads Components with their desired state and applies them on a Kubernetes cluster. It stores objects in the inventory.