indexer

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (

	// Pod indexes
	IndexFieldSandboxID    = indexFieldPrefix + agentsv1alpha1.SandboxIDLabelKey
	IndexFieldSandboxPool  = indexFieldPrefix + agentsv1alpha1.SandboxPoolLabelKey
	IndexFieldSandboxPhase = indexFieldPrefix + agentsv1alpha1.SandboxPhaseLabelKey

	// IndexFieldSandboxPoolPhase is a composite index combining pool name and phase,
	// stored as "poolName\x00phase" (NUL-byte separated to avoid collisions).
	// Use ListIdlePodsForPool() or SandboxPoolPhaseIndexValue() to query.
	IndexFieldSandboxPoolPhase = indexFieldPrefix + "sandbox-pool-phase"

	// Team/User indexes — shared across Pod and SandboxPool
	IndexFieldTeam = indexFieldPrefix + agentsv1alpha1.LabelTeam
	IndexFieldUser = indexFieldPrefix + agentsv1alpha1.LabelUser
)

Variables

This section is empty.

Functions

func GetFakeClientBuilderWithIndexers

func GetFakeClientBuilderWithIndexers() (*fake.ClientBuilder, error)

func GetPodBySandboxID

func GetPodBySandboxID(ctx context.Context, c client.Client, sandboxID string) (*corev1.Pod, error)

func IndexerFuncPodTeam

func IndexerFuncPodTeam(obj client.Object) []string

IndexerFuncPodTeam indexes a Pod by its scheduling team label.

func IndexerFuncPodUser

func IndexerFuncPodUser(obj client.Object) []string

IndexerFuncPodUser indexes a Pod by its scheduling user label.

func IndexerFuncPoolTeam

func IndexerFuncPoolTeam(obj client.Object) []string

IndexerFuncPoolTeam indexes a SandboxPool by its scheduling team label.

func IndexerFuncPoolUser

func IndexerFuncPoolUser(obj client.Object) []string

IndexerFuncPoolUser indexes a SandboxPool by its scheduling user label.

func IndexerFuncSandboxID

func IndexerFuncSandboxID(obj client.Object) []string

func IndexerFuncSandboxPhase

func IndexerFuncSandboxPhase(obj client.Object) []string

func IndexerFuncSandboxPool

func IndexerFuncSandboxPool(obj client.Object) []string

func IndexerFuncSandboxPoolPhase

func IndexerFuncSandboxPoolPhase(obj client.Object) []string

IndexerFuncSandboxPoolPhase returns the composite "poolName\x00phase" value, enabling efficient single-index queries for a specific pool+phase combination.

func ListIdlePodsForPool

func ListIdlePodsForPool(ctx context.Context, c client.Client, namespace, poolName string) ([]corev1.Pod, error)

ListIdlePodsForPool uses the composite pool+phase index for an efficient single-index query returning only idle pods in the given pool.

func ListPodsBySandboxPool

func ListPodsBySandboxPool(ctx context.Context, c client.Client, namespace, poolName string) ([]corev1.Pod, error)

func ListPodsBySandboxPoolAndPhase

func ListPodsBySandboxPoolAndPhase(ctx context.Context, c client.Client, namespace, poolName, phase string) ([]corev1.Pod, error)

func ListSandboxPoolsByTeamUser

func ListSandboxPoolsByTeamUser(ctx context.Context, c client.Client, namespace, team, user string) ([]agentsv1alpha1.SandboxPool, error)

ListSandboxPoolsByTeamUser returns all SandboxPools in the given namespace that match both team and user labels. Pass empty strings to skip a filter. When namespace is empty, the search spans all namespaces.

func SandboxPoolPhaseIndexValue

func SandboxPoolPhaseIndexValue(poolName, phase string) string

SandboxPoolPhaseIndexValue builds the composite index lookup value.

func SetupIndexers

func SetupIndexers(ctx context.Context, mgr ctrl.Manager) error

SetupIndexers registers all required indexes for the controller. This must be called before the manager starts, typically during setup.

Types

This section is empty.

Jump to

Keyboard shortcuts

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