Help us shape the future of Go! Take the 2026 Go Developer Survey

dependency

package
v0.117.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(objects []Dependent) ([]meta.NamespacedObjectReference, error)

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

Types

type Dependent

type Dependent interface {
	GetName() string
	GetNamespace() string
	meta.ObjectWithDependencies
}

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

Jump to

Keyboard shortcuts

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