dependency package - github.com/fluxcd/pkg/runtime/dependency - Go Packages

Package dependency contains an utility for sorting a set of Kubernetes resource objects that implement the Dependent interface.

This section is empty.

This section is empty.

Sort takes a slice of Dependent objects and returns a sorted slice of NamespacedObjectReference based on their dependencies. It performs a topological sort using a depth-first search algorithm, which has runtime complexity of O(|V| + |E|), where |V| is the number of vertices (objects) and |E| is the number of edges (dependencies).

Reference: https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search

Dependent interface defines methods that a Kubernetes resource object should implement in order to use the dependency package for ordering dependencies.