explanation

package
v0.0.0-...-f59ffe6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// The kubernetes client to use for processing decisions.
	client.Client
	// The controller will scope to objects using this operator name.
	// This allows multiple operators to coexist in the same cluster without
	// interfering with each other's decisions.
	OperatorName string
	// If the field indexing should be skipped (useful for testing).
	SkipIndexFields bool
}

The explanation controller populates two fields of the decision status.

First, it reconstructs the history of each decision. It will look for previous decisions for the same resource (based on ResourceID) and provide them through the decision history field.

Second, it will use the available context for a decision to generate a human-readable explanation of why the decision was made the way it was. This explanation is intended to help operators understand the reasoning behind scheduling decisions.

func (*Controller) Reconcile

func (c *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

This loop will be called by the controller-runtime for each decision resource that needs to be reconciled.

func (*Controller) SetupWithManager

func (c *Controller) SetupWithManager(mgr manager.Manager) error

This function sets up the controller with the provided manager.

func (*Controller) StartupCallback

func (c *Controller) StartupCallback(ctx context.Context) error

This function will be called when the manager starts up. Must block.

type Explainer

type Explainer struct {
	// The kubernetes client to use for fetching related data.
	client.Client
}

The explainer gets a scheduling decision and produces a human-readable explanation of why the decision was made the way it was.

func (*Explainer) Explain

func (e *Explainer) Explain(ctx context.Context, decision *v1alpha1.Decision) (string, error)

Explain the given decision and return a human-readable explanation.

Jump to

Keyboard shortcuts

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