crdschema

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package crdschema contains a controller that rebuilds the shared SSA TypeConverterProvider whenever a relevant CustomResourceDefinition changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	CRDGroups() map[string]struct{}
	IsCRDGroupRelevant(group string) bool
	Rebuild(ctx context.Context, logger logr.Logger, crds []*apiextensionsv1.CustomResourceDefinition) error
}

Provider is the subset of *ssa.TypeConverterProvider that Reconciler depends on. Narrowing to an interface keeps this package decoupled from the ssa package's internals and lets tests inject a fake.

type Reconciler

type Reconciler struct {
	client.Client

	LoggingMode logging.Mode
	Provider    Provider
}

Reconciler watches CustomResourceDefinitions and rebuilds the shared TypeConverterProvider whenever a relevant CRD changes.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is called whenever a relevant CRD is added, updated, or deleted. It lists only CRDs in the configured groups from the cache (via field index) and rebuilds the provider's TypeConverter in-process.

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(_ context.Context, mgr ctrl.Manager) error

SetupWithManager registers the reconciler with the manager. The spec.group field index this relies on (see index.OptionsForCRDSchema) is registered centrally by modules/manager.SetupCacheIndexes.

Jump to

Keyboard shortcuts

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