controllerruntime

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package controllerruntime provides integration utilities between the controller-runtime framework and the SDK's core abstractions.

It defines a generic apiSource that acts as a live, controller-managed Source of Kubernetes API objects. This allows the SDK to automatically track, reconcile, and serve Kubernetes resources as typed data sources within an evaluation engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApiSource

func NewApiSource[API any, API_PTR api[API]](name string, mgr ctrl.Manager, options controller.Options) (*apiSource[API, API_PTR], error)

NewApiSource creates and registers a new controller-runtime managed source for a specific Kubernetes API type.

The returned apiSource watches and maintains an in-memory cache of the specified resource type. It can be used as a core.Source for engine components.

Type parameters:

API — a Kubernetes API object type (must satisfy client.Object)

Parameters:

mgr     — controller-runtime manager used to build/register the controller
options — controller options like concurrency, rate limiting, etc.

Returns:

*apiSource[API] — a live-updating source of API objects
error           — if controller setup fails

Example:

type MyResource v1.ConfigMap
src, err := controllerruntime.NewApiSource[*v1.ConfigMap](mgr, controller.Options{})
if err != nil {
    log.Fatal(err)
}
objs, _ := src.Load(ctx) // snapshot of current ConfigMaps

Types

This section is empty.

Jump to

Keyboard shortcuts

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