transform

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package transform provides cache transform functions for reducing memory usage in the PAC watcher informer caches.

Transform functions are applied to objects before they are stored in the informer cache, allowing us to strip large, unnecessary fields while preserving the data needed for reconciliation.

DEVELOPER WARNING: If you add new reconciliation logic that reads a field from cached objects (via listers), you MUST verify that field is not stripped by these transforms. Fields stripped from cached objects will be nil/empty even though they exist in etcd. If you need a stripped field, fetch the full object via the API client instead of the lister.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PipelineRunForCache

func PipelineRunForCache(obj any) (any, error)

PipelineRunForCache strips fields from PipelineRun objects before they are stored in the informer cache to reduce memory usage.

Fields the PAC watcher reads from cached PipelineRuns:

  • ObjectMeta: name, namespace, labels, annotations (PAC state/repo keys), finalizers, deletionTimestamp
  • Spec.Status: checked for PipelineRunSpecStatusPending
  • Status.Conditions: checked for completion state and reason
  • Status.StartTime, Status.CompletionTime: used for metrics

All other Spec and Status fields are stripped. When the reconciler needs the full object (e.g. postFinalStatus, GetStatusFromTaskStatusOrFromAsking), it fetches it directly from the API server.

func RepositoryForCache

func RepositoryForCache(obj any) (any, error)

RepositoryForCache strips fields from Repository objects before they are stored in the informer cache to reduce memory usage.

Fields stripped:

  • ManagedFields: written by the API server, not needed for reconciliation
  • Annotations: no reconciler logic reads Repository annotations from the lister; the largest annotation is kubectl.kubernetes.io/last-applied-configuration
  • Status: the reconciler always fetches Repository.Status via a direct API call before updating it; it is never read from the lister

Types

This section is empty.

Jump to

Keyboard shortcuts

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