customresourcesgate

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 458

Documentation

Overview

Package customresourcesgate implements a CustomResourceReconciler to report GKVs status to a Gate. This reconciler requires cluster scoped GET,LIST,WATCH on customresourcedefinitions[apiextensions.k8s.io]

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(mgr ctrl.Manager, o controller.Options) error

Setup adds a controller that reconciles CustomResourceDefinitions to support delayed start of controllers. o.Gate is expected to be something like *gate.Gate[schema.GroupVersionKind].

func TransformStripCRDSchema added in v2.3.4

func TransformStripCRDSchema(obj any) (any, error)

TransformStripCRDSchema is a cache.TransformFunc that removes heavy fields from CustomResourceDefinition objects before they are stored in the informer cache. It strips:

  • Spec.Versions[].Schema (OpenAPI v3 validation schemas)
  • ObjectMeta.ManagedFields
  • The "kubectl.kubernetes.io/last-applied-configuration" annotation

This significantly reduces memory usage in clusters with many CRDs. The CRD gate reconciler only needs basic metadata (group, kind, version names, served status) and status conditions to function correctly.

Usage:

cache.Options{
    ByObject: map[client.Object]cache.ByObject{
        &apiextensionsv1.CustomResourceDefinition{}: {
            Transform: customresourcesgate.TransformStripCRDSchema,
        },
    },
}

Types

type Reconciler

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

Reconciler reconciles a CustomResourceDefinitions in order to gate and wait on CRD readiness to start downstream controllers.

func (*Reconciler) Reconcile

Reconcile reconciles CustomResourceDefinitions and reports ready and unready GVKs to the gate.

Jump to

Keyboard shortcuts

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