inventory

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CustomResourceDefinition = "CustomResourceDefinition"
	Namespace                = "Namespace"
)

Variables

This section is empty.

Functions

func AddStaticResourceScope

func AddStaticResourceScope(gk schema.GroupKind, namespaced bool)

func CreateObjectsInventory

func CreateObjectsInventory(namespace, name string, objects []runtime.Object) (*core.ConfigMap, error)

func GetObjectsFromInventory

func GetObjectsFromInventory(inventory core.ConfigMap) (objects []runtime.Object)

Types

type Inventory

type Inventory struct {
	// contains filtered or unexported fields
}

A generalized structure to enable us to attach additional inventory management around the native reconcile loop and adds the capability to store state between reconcile phases (see operator-tool's NativeReconciler)

func NewDiscoveryInventory

func NewDiscoveryInventory(client client.Client, log logr.Logger, discovery discovery.DiscoveryInterface) *Inventory

func NewInventory

func NewInventory(client client.Client, log logr.Logger, clusterResources map[string]struct{}) (*Inventory, error)

func (*Inventory) Append

func (i *Inventory) Append(namespace, component string, parent reconciler.ResourceOwner, resourceBuilders []reconciler.ResourceBuilder) ([]reconciler.ResourceBuilder, error)

func (*Inventory) IsClusterScoped

func (c *Inventory) IsClusterScoped(obj runtime.Object) (bool, error)

IsClusterScoped returns true of the type if the specified resource is of cluster scope. It returns false for namespace scoped resources.

func (*Inventory) PrepareDeletableObjects

func (c *Inventory) PrepareDeletableObjects() error

Collect `missing` resources from desired state

func (*Inventory) PrepareDesiredObjects

func (c *Inventory) PrepareDesiredObjects(ns, componentName string, parent reconciler.ResourceOwner, resourceBuilders []reconciler.ResourceBuilder) (*core.ConfigMap, error)

Fetch list of resources made by the previous reconcile loop and store into an attached context Return a new list of resources which will be reconciled among with the other resources we listed here

func (*Inventory) TypesToPurge

func (c *Inventory) TypesToPurge() []schema.GroupVersionKind

Hand over a GVK list to the native reconcile loop's purge method

type InventoryData

type InventoryData struct {
	ObjectsToDelete []runtime.Object
	CurrentObjects  []runtime.Object
	DesiredObjects  []runtime.Object
}

State holder between reconcile phases

Jump to

Keyboard shortcuts

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